Forums / Setup & design / Attribute filter (in template) - parse error

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