Where does this 'B' come from in my template after upgrade to 3.2

Author Message

Tonny Laursen

Wednesday 24 September 2003 9:45:04 am

I have just upgraded from 3.1 to 3.2 and after that I got this problem.

At the bottom of my template I have a 'B' if there is no file attached. If there is a file attached then there is no B just the filename.

If template debug is turned on I can see that it is using this template:
design/standard/templates/content/datatype/view/ezbinaryfile.tpl

This file is the standard from v3.2 and contains

<a href={concat("content/download/",$attribute.contentobject_id,"/",$attribute.id,"/file/",$attribute.conte
nt.original_filename)|ezurl}>{$attribute.content.original_filename|wash(xhtml)}</a> {$attribute.content.fil
esize|si(byte)}

What is wrong?

Tonny

Tonny Laursen

Thursday 25 September 2003 11:32:20 pm

In debug output I get the following, can this help to locate the problem?

Warning: eZTemplate:gt Sep 26 2003 08:25:39
Unsupported type: boolean( ), must be either array, attribute object or numerical
Error: eZTemplate Sep 26 2003 08:25:39
Cannot retrieve attribute of a boolean
Error: eZTemplate Sep 26 2003 08:25:39
Cannot retrieve attribute of a boolean
Error: eZTemplate Sep 26 2003 08:25:39
Cannot retrieve attribute of a boolean

Tonny Laursen

Tuesday 07 October 2003 1:27:44 am

In my override template i have the following:

{attribute_view_gui attribute=$content_version.data_map.file}<br>
{attribute_view_gui attribute=$content_version.data_map.file2}<br>
{attribute_view_gui attribute=$content_version.data_map.file3} <br>

Tonny Laursen

Monday 13 October 2003 11:53:39 pm

Now I'm trying again to locate the "B" but I cannot find it. Could someone please give me a hint?

Alex Jones

Tuesday 14 October 2003 6:38:08 am

Tonny, try removing or changing the value of |si(byte). It may be that it is tacking on the 'B' when the filesize attribute doesn't apply (as there isn't a file). If this ends up being the case you may want to write a section show statement to ensure the attribute is only displayed for entries that have a file associated with them.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Tonny Laursen

Wednesday 15 October 2003 12:16:32 am

Correct it was the |si(byte). Now I have tried with the following:
{1025|si(byte)}
{1025|si(byte,binary)}
{1025|si(byte,decimal)}
{1025|si(byte,none)}
{1025|si(byte,auto)}
{1025|si(byte,mebi)}

But all of them give the same result. Now I have removed the feature, that shows what size the file have.
It will be nice if someone could describe a solution?

Thanks,

Tonny

Tore Skobba

Friday 28 November 2003 7:06:48 am

Hi

Had the same problem.. Here is my "solution":

{section show=$node.data_map.attachment.content}
{attribute_view_gui attribute=$node.data_map.attachment}
{/section}

Where attachment is the file attribute. Is it ok to simply do a section show without any checks on the actual content? Tried to use the is_empty but that did not work? And this version checking on file name:

{section show=ne($node.data_map.attachment.content.filename,"")}

gave an debug error message, cannot retrive an boolean, for objects not having an binary file.

Cheers Tore

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.