problems combining class and attribute_filter in templates

Author Message

Christiane Kloss

Tuesday 10 May 2005 8:10:42 am

Dear eZ-crew,

I think I'll become mad today....

I'm using the following code:

{let redaktions_items=fetch( 'content','list',
							hash( 'parent_node_id', $node.node_id,
								'class_filter_type',  'include',
              					'class_filter_array', array( 'redakt_item' ),
              					'attribute_filter_array', array( 'and', array( 'redakt_item/status', '=', '1' ) ),
              					'sort_by', array( 'priority', false() ) ))
}

{section var=redakt_item loop=$redaktions_items}
 	{$redakt_item.name}:{$redakt_item.data_map.status.data_text}<br />
{/section}

Output:
--------
live/ on Tour:1
live/ on Screen:1
live/ on Air:1
live Kreuzfahrt:1
overview Termine:1
Galerie/ Unterwegs:1
<b>Booking:3</b>
Red/ Kartenservice:1

Why is Booking still there?

I'm using similar fetch (include only special class + attribute_filter) in other templates - and it is working fine.
Seperately it is working fine in this template:
include only redakt_items - all redakt_items appear,
attribute_filter on array( 'redakt_item/status', '=', '1' ) - Booking disappears, but of course the other classes will be displayed too...

status is an ezselection with single choice.

I'm using 3.5.2 (just upgraded from 3.5.1, hoping the problem might disappear...)
on Mac OX 10.3 with mysql 4.0.20

Any hints are very welcome....

Greetings Christiane

Marko Žmak

Tuesday 10 May 2005 4:59:30 pm

Try using 'attribute_filter' instead of 'attribute_filter_array' :) Se also:

http://www.ez.no/ez_publish/documentation/reference/data_fetching/content/list

for documentation about fetch.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Christiane Kloss

Wednesday 11 May 2005 1:15:18 am

Hi Marko,

I swear (!) I read the docu and the forum again and again....but didn't see what was wrong...

In German we say: "Wer lesen kann, ist klar im Vorteil." In English it means:"Someone, who can read, should take advantage of this"

Thank you very very much
I'm sure I will never forget this attribute_filter ;-)))

Christiane

Marko Žmak

Wednesday 11 May 2005 11:42:34 am

I'm also sure you won't forget it. :)

Something similar happened to me several times. The first thing to check when something doesn't work is if you written everything right - that saves a lot of time and work.

Also try using debug in eZ. Put this into your site.ini.append.php:

[DebugSettings]
DebugOutput=enabled

it helps a lot and can give you usefull warnings about errors in your code.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Christiane Kloss

Thursday 12 May 2005 4:07:15 am

Hi Marko,

debug was enabled, but unfortunatly no error or warning occurred.
At some point I was unable to relax - and in my mind this is one of the most important abilities when someone is dealing with eZ (easy)....;-)))

Greetings
Christiane

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

Main resources:

Total runtime0.0153 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.1719152.6563
Module start 'layout' 0.00700.0025 740.828139.5078
Module start 'content' 0.00950.0039 780.335993.5234
Module end 'content' 0.01340.0018 873.859438.3047
Script end 0.0152  912.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002415.6830140.0002
Check MTime0.00117.1075140.0001
Mysql Total
Database connection0.00138.456810.0013
Mysqli_queries0.002516.251530.0008
Looping result0.00000.096810.0000
Template Total0.001610.410.0016
Template load0.00095.614510.0009
Template processing0.00074.716510.0007
Override
Cache load0.00063.951210.0006
General
dbfile0.00021.499380.0000
String conversion0.00000.054740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs