Forums / Developer / Fetch List by Wildcard Attribute

Fetch List by Wildcard Attribute

Author Message

Jough Dempsey

Monday 10 December 2007 1:33:25 pm

Hi,

I'm trying to write a simple search for people whose "last_name" attribute begins with a certain letter of the alphabet (for a directory listing).

I tried to use the content list fetch function to set an attribute filter on the attribute ID and perform a like search.

For example, here's the code that returns no matches. The parent_node_id fetch itself works and returns the correct objects. It's just that limiting to a certain attribute by either its ID (183) or "people/last_name" doesn't seem to work:

  {def $results = fetch('content', 'list',
                        hash('parent_node_id', 64
                        'attribute_filter', array(array(183, 'like', 'd*')))
                       )}

Any ideas?

Using eZ Publish 3.9 on Ubuntu Linux.

Jough Dempsey
Senior Developer
D U O : C O N S U L T I N G
Web Content Management Experts
http://www.duoconsulting.com

Jough Dempsey

Monday 10 December 2007 2:32:49 pm

Well, it seems I found a bug.

It works if you do the same search of "list_count" first, then do a "list" fetch. It doesn't work if you just do a "list" fetch.

FYI.

Jough Dempsey
Senior Developer
D U O : C O N S U L T I N G
Web Content Management Experts
http://www.duoconsulting.com