Attribute filter with files

Author Message

Olav Frengstad

Monday 21 February 2011 1:19:19 am

Hey,

Im trying to fetch the latest node that HAS a file attached to it but can't seem to make it work:

{def $item = fetch('content',
                    'tree',
                    hash( 'parent_node_id', 60,
                        'limit', 1,
                        'class_filter_type', 'include',
                        'class_filter_array', array( 'news' ),
                        'attribute_filter', array('and',
                            array( 'news/podcasturl', '!=', null())
                        )
                   )
)}


Iv tried to look through SQL debug and it doesnt even look like the query is performed :/
Why don't the null() operator work? i tried false, and '' also with no luck...

André R.

Monday 21 February 2011 1:43:40 am

You have a better chanche trying testing against empty string, 1. that is usually what's in the db 2. null() in the tempalte language is just a check for null, aka does the same thing as is_null()

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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:56:17
Script start
Timing: Jan 18 2025 02:56:17
Module start 'layout'
Timing: Jan 18 2025 02:56:17
Module start 'content'
Timing: Jan 18 2025 02:56:17
Module end 'content'
Timing: Jan 18 2025 02:56:17
Script end

Main resources:

Total runtime0.7185 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9141152.6250
Module start 'layout' 0.00540.0032 740.539139.4531
Module start 'content' 0.00860.7085 779.9922525.5781
Module end 'content' 0.71700.0014 1,305.57038.1641
Script end 0.7184  1,313.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4341160.0002
Check MTime0.00120.1671160.0001
Mysql Total
Database connection0.00060.084210.0006
Mysqli_queries0.670693.3380540.0124
Looping result0.00050.0711520.0000
Template Total0.678494.420.3392
Template load0.00200.272820.0010
Template processing0.676494.151220.3382
Template load and register function0.00020.031910.0002
states
state_id_array0.00200.276910.0020
state_identifier_array0.00110.151920.0005
Override
Cache load0.00150.2126120.0001
Sytem overhead
Fetch class attribute can translate value0.00080.109120.0004
Fetch class attribute name0.00110.152830.0004
XML
Image XML parsing0.00070.094820.0003
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00620.8565170.0004
String conversion0.00000.001340.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
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs