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

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 11:19:33
Script start
Timing: Jan 18 2025 11:19:33
Module start 'layout'
Timing: Jan 18 2025 11:19:33
Module start 'content'
Timing: Jan 18 2025 11:19:34
Module end 'content'
Timing: Jan 18 2025 11:19:34
Script end

Main resources:

Total runtime0.7049 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 587.9219152.6250
Module start 'layout' 0.00520.0028 740.546939.4453
Module start 'content' 0.00810.6954 779.9922452.4453
Module end 'content' 0.70350.0013 1,232.43758.1563
Script end 0.7048  1,240.5938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4646160.0002
Check MTime0.00130.1841160.0001
Mysql Total
Database connection0.00070.102010.0007
Mysqli_queries0.659993.6233520.0127
Looping result0.00050.0753500.0000
Template Total0.671495.320.3357
Template load0.00190.270820.0010
Template processing0.669594.978620.3347
Template load and register function0.00020.035210.0002
states
state_id_array0.00100.145910.0010
state_identifier_array0.00170.235720.0008
Override
Cache load0.00160.2220140.0001
Sytem overhead
Fetch class attribute can translate value0.00220.307410.0022
Fetch class attribute name0.00100.135720.0005
XML
Image XML parsing0.00010.018310.0001
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00140.1997100.0001
String conversion0.00000.000840.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs