attribute_filter and date handling

Author Message

Nick Woods

Friday 20 February 2004 7:33:02 am

I have a custom class called club_event_item which has a field of type date called event_date (attribute id is 171)

I want to find the next event after the current one based on the date.

This is my code :-

{let next_item=fetch( content, list, hash
( parent_node_id, $node.parent.node_id,
class_filter_type, include,
class_filter_array, array( 'club_event_item' ),
limit, 1,
attribute_filter, array( and, array( 'club_event_item/event_date', '>', $node.object.data_map.event_date) ),
sort_by, array(array('attribute' , true(),171) )
) )
}

I have had it return results by subsituting currentdate() for $node.object.data_map.event_date, i:e :-

( 'club_event_item/event_date', '>', currentdate) ),

so it must be something to do with the way I'm passing in the date from the current record

Any ideas ?

Nick Woods

Friday 20 February 2004 1:13:43 pm

After about 4 hours of fiddling around with this I think I've fixed it. The solution is to use data_int in the where clause :-

attribute_filter, array( and, array( 'club_event_item/event_date', '>',$node.object.data_map.event_date.data_int ) ),

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 19 2025 12:49:54
Script start
Timing: Jan 19 2025 12:49:54
Module start 'layout'
Timing: Jan 19 2025 12:49:54
Module start 'content'
Timing: Jan 19 2025 12:49:56
Module end 'content'
Timing: Jan 19 2025 12:49:56
Script end

Main resources:

Total runtime1.1384 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.0054 590.3906152.6250
Module start 'layout' 0.00540.0039 743.015639.4453
Module start 'content' 0.00931.1273 782.4609424.8906
Module end 'content' 1.13660.0017 1,207.35168.1563
Script end 1.1383  1,215.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2721160.0002
Check MTime0.00130.1126160.0001
Mysql Total
Database connection0.00070.065410.0007
Mysqli_queries1.098696.5067520.0211
Looping result0.00050.0426500.0000
Template Total1.106397.220.5532
Template load0.00230.198420.0011
Template processing1.104096.984120.5520
Template load and register function0.00020.017710.0002
states
state_id_array0.00160.139910.0016
state_identifier_array0.00110.097620.0006
Override
Cache load0.00180.1571220.0001
Sytem overhead
Fetch class attribute can translate value0.00060.048910.0006
Fetch class attribute name0.00100.086420.0005
XML
Image XML parsing0.00010.009710.0001
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00070.0626100.0001
String conversion0.00000.000940.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/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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