attribute_filter ezselection

Author Message

ruud prein

Thursday 22 April 2004 3:32:55 am

Hi,

I am trying to use a fetch with an attribute_filter on an datatype ezselection with the following commands:
1) children=fetch('content','list',hash(parent_node_id,$node.node_id,'attribute_filter', array(array( 197, '=', 1)))}
2) children=fetch('content','list',hash(parent_node_id,$node.node_id,'attribute_filter', array('or',array( 197, '=', 1)))}
3) children=fetch('content','list',hash(parent_node_id,$node.node_id,'attribute_filter', array(array( 197, '=', 'string')))}
4) children=fetch('content','list',hash(parent_node_id,$node.node_id,'attribute_filter', array('or',array( 197, '=', 'string')))}

None are working at all, what am i missing here?

regards,

Ruud

---
groet,

Ruud

Eirik Alfstad Johansen

Thursday 22 April 2004 4:36:18 am

Hi ruud,

Try using attribute_filter without the surrounding quotes. Then probably alternative 2 or 4 will work.

Sincerely,

Eirik Johansen
http://www.netmaking.no

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

ruud prein

Thursday 22 April 2004 11:49:31 am

sorry but
2 and 4 are not working either without the quotes
children=fetch('content','list',hash(parent_node_id,$node.node_id,attribute_filter,array('or',array( 197, '=', 1))))}

With the 1 I mean the 1st selection. Even if I replace the 1 with the string content it does not work. I get an empty array back.

any help welkom.

regards,

Ruud

---
groet,

Ruud

Paul Forsyth

Thursday 22 April 2004 11:59:20 am

Ruud,

Are you sure that the node is valid? Can you check $node.node_id has a value?

It might be worth looking at the attributes of your node to see what the value for 197 actually is. If it doesnt match you wont get anything back.

Try

{$node.data_map|attribute(show)}

paul

--
http://www.visionwt.com

ruud prein

Thursday 22 April 2004 12:09:42 pm

197 is an attribute of an ezselection type.
When I do the fetch without the attribute_filter, I get large array of all children. But with the filter the array is empty
the selection is filled with (single selection)
1: Raoul
2: Ruud
3: Wander

Do you have any ideas?

regards,

Ruud
--

---
groet,

Ruud

Paul Forsyth

Thursday 22 April 2004 12:16:39 pm

Im not 100% sure of what the ezselection datatype returns as a value. Can you try that {$node.data_map|attribute(show)} to see what the value is? What does it say? Remember to have debug on...

paul

--
http://www.visionwt.com

ruud prein

Thursday 22 April 2004 12:34:33 pm

The debug does not reveal anything

$node.node_id|attribute(show) just outputs:

Attribute Type Value

does not look good?

Ruud

---
groet,

Ruud

ruud prein

Thursday 22 April 2004 1:07:43 pm

If I use the attribute_filter on a ezstring it does work!! Kan I use * in the string? to catch series of string together??

But when I use the attribute_filter on ezselection I get nothing back?

any help welkom

regards,

Ruud
---

---
groet,

Ruud

Paul Forsyth

Thursday 22 April 2004 1:39:09 pm

When i tried it myself it works:

{let
children=fetch('content','list',hash(parent_node_id,2,'attribute_filter',array(array( 221, '=', 2))))}
{$children|attribute(show)}
{/let}

You have to make sure your attribute id is correct, and that the value you want to check exists.

This is using ez 3.3-4

paul

--
http://www.visionwt.com

ruud prein

Thursday 22 April 2004 1:48:29 pm

Thanx, just to make sure:
is the value 2 a value in the selection array? Or is 2 the 2nd option in the selection?

regards,

Ruud

---
groet,

Ruud

Paul Forsyth

Thursday 22 April 2004 2:06:52 pm

2 is the 2nd option. The ezselection datatype stores the selected option.

I tried this out locally and it works here.

Try again. I notice in your examples you had the wrong number of brackets.

paul

--
http://www.visionwt.com

ruud prein

Thursday 22 April 2004 2:08:27 pm

I have tried it. It works!! But only for selection 2 and 3. NOT for 1?? Is This a BUG?

regards

Ruud

---
groet,

Ruud

Paul Forsyth

Thursday 22 April 2004 2:33:07 pm

Had a quick look at the code and it does appear to be a bug.

For some reason the options start at 0, skip 1, then works as normal for 2, 3 and so on.

The initialisation of the ezselection datatype is wrong. I'll file a bug about it.

Hope you can work around this until the bug is fixed.

paul

--
http://www.visionwt.com

Paul Forsyth

Thursday 22 April 2004 2:37:22 pm

Filed it:

http://ez.no/community/bug_reports/ezselection_xml_is_initialised_with_wrong_id

Phew, that was a weird one!

paul

--
http://www.visionwt.com

ruud prein

Thursday 22 April 2004 3:37:36 pm

Thanx Paul!!

---
groet,

Ruud

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

Main resources:

Total runtime0.7460 sec
Peak memory usage4,096.0000 KB
Database Queries95

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 587.9141152.6250
Module start 'layout' 0.00510.0023 740.539139.4453
Module start 'content' 0.00740.7372 779.9844709.1953
Module end 'content' 0.74460.0013 1,489.179724.1641
Script end 0.7459  1,513.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4054160.0002
Check MTime0.00120.1650160.0001
Mysql Total
Database connection0.00110.141210.0011
Mysqli_queries0.659288.3737950.0069
Looping result0.00080.1022930.0000
Template Total0.718196.320.3591
Template load0.00200.270720.0010
Template processing0.716195.995320.3580
Template load and register function0.00020.020610.0002
states
state_id_array0.00090.115310.0009
state_identifier_array0.00070.089920.0003
Override
Cache load0.00180.24711060.0000
Sytem overhead
Fetch class attribute can translate value0.00080.102730.0003
Fetch class attribute name0.00090.1193160.0001
XML
Image XML parsing0.00070.092530.0002
class_abstraction
Instantiating content class attribute0.00000.0034160.0000
General
dbfile0.00100.1369160.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
15content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
26content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
13content/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
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: 58
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs