Attribute filter (in template) - parse error

Author Message

Marin Orlic

Wednesday 28 September 2005 4:18:29 am

Hi all,

I'm having some troubles when specifying attribute_filter in content/list fetch. It seems that the parser is sensitive to whitespaces - I get 'Empty variable name' errors for no apparent reason.

The error can usually be fixed by replacing TABs with spaces or deleting whitespaces completely.

Did anybody have the same troubles? Should I report it as a bug?

eZ 3.7.0rc2, php4.4

Thx,
Marin.

Marko Žmak

Wednesday 28 September 2005 3:43:14 pm

Could you paste here some of your offending code, so that someone can test it?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marin Orlic

Thursday 29 September 2005 6:36:57 am

I will. I'm trying to figure out what could be the cause of the error.

Marin Orlic

Thursday 29 September 2005 2:24:43 pm

Ok for instance this doesn't work..

{let users=fetch( content, list, hash( parent_node_id, 230, 
                                       class_filter_type, include,
                                       class_filter_array, array ( 38 ),
                                       attribute_filter, array ( and, array ( 294, '=', '1' ) ) ) ) )}

Gives

Empty variable name at [( content, list, hash( parent_node_id, 230, 
                                       class_filter_type, include,
                                       class_filter_array, array ( 38 ),
                                       attribute_filter, array ( and, array ( 294, '=', '1' ) ) ) ) )]

Marko Žmak

Thursday 29 September 2005 2:51:23 pm

I think you have one right bracket too much. Try removing it and see what happens.

P.S. A tip: aligning your right brackets with their left bracket pair can be really useful. Like this for example:

{let users=fetch( content, list, hash( parent_node_id, 230, 
                                       class_filter_type, include,
                                       class_filter_array, array ( 38 ),
                                       attribute_filter, array ( and, array ( 294, '=', '1' ) )
                                     )
                )
}

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Leif Arne Storset

Sunday 11 May 2008 3:46:37 pm

I don't know if helped Orlic, but I found Zmak's advice to apply to my situation. Two missing right parens gave caused an "Empty variable name" error for me. I don't quite understand why, even after staring at the relevant PHP code for a while.

Leif Arne Storset

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

eZ debug

Timing: Jan 18 2025 02:11:02
Script start
Timing: Jan 18 2025 02:11:02
Module start 'layout'
Timing: Jan 18 2025 02:11:02
Module start 'content'
Timing: Jan 18 2025 02:11:03
Module end 'content'
Timing: Jan 18 2025 02:11:03
Script end

Main resources:

Total runtime0.7331 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.1641152.6406
Module start 'layout' 0.00720.0048 741.804739.4766
Module start 'content' 0.01200.7200 781.2813612.9141
Module end 'content' 0.73190.0011 1,394.195316.1250
Script end 0.7331  1,410.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4535160.0002
Check MTime0.00140.1879160.0001
Mysql Total
Database connection0.00130.182510.0013
Mysqli_queries0.663790.5278680.0098
Looping result0.00070.0967660.0000
Template Total0.693794.620.3468
Template load0.00190.254320.0009
Template processing0.691894.362620.3459
Template load and register function0.00020.028510.0002
states
state_id_array0.00140.188910.0014
state_identifier_array0.00110.152120.0006
Override
Cache load0.00160.2149280.0001
Sytem overhead
Fetch class attribute can translate value0.00070.089530.0002
Fetch class attribute name0.00100.142880.0001
XML
Image XML parsing0.00130.174630.0004
class_abstraction
Instantiating content class attribute0.00000.002190.0000
General
dbfile0.00200.2762240.0001
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs