Forums / Developer / attribute_filter ezselection

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

eZ debug

Timing: Jan 18 2025 19:11:58
Script start
Timing: Jan 18 2025 19:11:58
Module start 'content'
Timing: Jan 18 2025 19:11:59
Module end 'content'
Timing: Jan 18 2025 19:11:59
Script end

Main resources:

Total runtime0.9187 sec
Peak memory usage4,096.0000 KB
Database Queries232

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.7109180.8359
Module start 'content' 0.00610.7644 768.5469714.2734
Module end 'content' 0.77050.1480 1,482.8203353.3125
Script end 0.9185  1,836.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4490210.0002
Check MTime0.00160.1761210.0001
Mysql Total
Database connection0.00100.104810.0010
Mysqli_queries0.813888.58462320.0035
Looping result0.00240.26402300.0000
Template Total0.887496.620.4437
Template load0.00210.232620.0011
Template processing0.885296.359220.4426
Template load and register function0.00020.016710.0002
states
state_id_array0.00070.080710.0007
state_identifier_array0.00090.094620.0004
Override
Cache load0.00210.22521060.0000
Sytem overhead
Fetch class attribute can translate value0.00240.265440.0006
Fetch class attribute name0.00130.1368160.0001
XML
Image XML parsing0.00100.113440.0003
class_abstraction
Instantiating content class attribute0.00000.0022160.0000
General
dbfile0.00580.6274270.0002
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 58
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs