Forums / Setup & design / Attribute fliter with integer problem

Attribute fliter with integer problem

Author Message

laurent le cadet

Saturday 11 February 2006 1:06:25 am

Hi,

I'm trying to fliter with attribute where my attribute is an integer. (eZ 3.5.1).
I tryed almost everything without result (attribute ID (346), with 'or', array ...)...

{let rubrique_noeud=5644
  news_list=fetch('content','list',hash( parent_node_id, $rubrique_noeud,
  class_filter_type, 'include',
  class_filter_array, array( 'annonce' ),
  attribute_filter, array (array('annonce/creditrestant', '>=', 0))))}
      {section name=News loop=$news_list max=5}
          {node_view_gui view=random_locations content_node=$News:item}
      {/section}
{/let}

No result.

Help ;) !

Laurent

Kristof Coomans

Saturday 11 February 2006 2:11:55 am

Did you get any debug errors or warnings?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

laurent le cadet

Saturday 11 February 2006 2:32:00 am

Hi Kristoff,

I tryed with attribute|show :

node_id string 5737 
parent_node_id string 5644 
main_node_id string 5737 
contentobject_id string 5653 
contentobject_version string 3 
contentobject_is_published string 1 
depth string 3 
sort_field string 2 
sort_order string 0 
priority string 0 
modified_subnode string 1139593251 
path_string string '/1/2/5644/5737/' 
path_identification_string string 'locations_saisonnieres/rennes_35_appartement_t1_1_personne' 
remote_id string 'c7ffafb37ce68701e27600fe13a9357d' 
is_hidden string 0 
is_invisible string 0 
name string 'rennes (35) | Appartement T1 | 1 personne' 
data_map array Array(28) 
>auteur object[ezcontentobjectattribute] Object 
>creditrestant object[ezcontentobjectattribute] Object 
...

Any idea ?

Kristof Coomans

Saturday 11 February 2006 2:47:32 am

Hi Laurent

It's Kristof, not Kristoff ;)

Where did you place the attribute|show? And did you create a random_locations view template?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

laurent le cadet

Sunday 12 February 2006 11:43:46 pm

Kristof,

I placed the attribute show in the loop :

<node>
{section name=News loop=$news_list max=5}
{*{node_view_gui view=random_locations content_node=$News:item}*}

HERE

{/section}
</node>

And yes I created the random_locations.tpl (node/view).

Everything works fine without the fetch based on attribute.

Here's the whole structure :

A include in a cutsom folder.tpl :

{cache-block}
{include uri="design:random_locations.tpl"}
{/cache-block}

random_locations.tpl :

{set-block scope=root variable=cache_ttl}86400{/set-block}
{let rubrique_noeud=5644
news_list=fetch('content','list',hash( parent_node_id, $rubrique_noeud,
class_filter_type, 'include',
class_filter_array, array( 'annonce' )))|shuffle}	
{section name=News loop=$news_list max=5}
{node_view_gui view=random_locations content_node=$News:item}
{/section}
{/let}

This one is ok and print "annonce" class with the custom view.
No way when I add a fecth based on attribute.

And finally, the custom view :

<div class="content-view-random-locations">
<div class="class-article">
<div class="location-short">
{section show=$node.object.data_map.photo1.content}
<div class="attribute-image">
<div class="crop">
<a href={$node.url_alias|ezurl}>{attribute_view_gui image_class=small attribute=$node.object.data_map.photo1}</a>
</div>
</div>
{/section}
{$node.object.data_map.ville.content} ({$node.object.data_map.cp1.content})<br>
{attribute_view_gui attribute=$node.object.data_map.typedebien}
{attribute_view_gui attribute=$node.object.data_map.nbpersonnes}
</div>
</div>
</div>

Ɓukasz Serwatka

Monday 13 February 2006 1:35:46 am

Hi Laurent,

You have syntax error in your code.

Use:

array( array( 'annonce/creditrestant', '>=', 0 ) )

instead of

array (array('annonce/creditrestant', '>=', 0))

Kristof asked above about warnings, it is good to enable DebugOutput on development time ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

laurent le cadet

Monday 13 February 2006 2:00:18 am

Hi Lukasz,

I didn't know it was so sensitive !
Thanks.

Laurent.

Debug : It's development time but with 667 pairs of eyes watching at me at the moment ;)

Paul Forsyth

Monday 13 February 2006 3:58:33 am

Is that a bug with the parser if its affected by whitespace?

laurent le cadet

Monday 13 February 2006 5:05:29 am

it sounds like...

Paul Forsyth

Monday 13 February 2006 7:44:33 am

Do you want to do the honours?

laurent le cadet

Monday 13 February 2006 9:25:21 am

sorry, I don't understand :(

Paul Forsyth

Monday 13 February 2006 9:36:15 am

Do you want to file the bug because you discovered it :)

laurent le cadet

Monday 13 February 2006 9:55:27 am

do you think it's a bug or just a kind of typo ?
But I can report it as a bug.

Laurent

Paul Forsyth

Monday 13 February 2006 10:15:39 am

Maybe im going blind but it looks like an extra space in the wrong part of the function causes it to fail? If thats the case then it is a bug.

Paul Forsyth

Monday 13 February 2006 10:17:41 am

I think i am going blind. Its the first space thats relevant, between the array and '('. yes thats just a typo. i read too much into the other spaces.

eZ debug

Timing: Jan 18 2025 22:31:38
Script start
Timing: Jan 18 2025 22:31:38
Module start 'content'
Timing: Jan 18 2025 22:31:39
Module end 'content'
Timing: Jan 18 2025 22:31:39
Script end

Main resources:

Total runtime1.5932 sec
Peak memory usage4,096.0000 KB
Database Queries234

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0128 587.8359180.8281
Module start 'content' 0.01281.2872 768.6641774.6797
Module end 'content' 1.30000.2931 1,543.3438358.5703
Script end 1.5931  1,901.9141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00500.3111210.0002
Check MTime0.00170.1088210.0001
Mysql Total
Database connection0.00220.141110.0022
Mysqli_queries1.463791.87082340.0063
Looping result0.00300.18772320.0000
Template Total1.550897.320.7754
Template load0.00270.168820.0013
Template processing1.548097.165020.7740
Template load and register function0.00010.008710.0001
states
state_id_array0.00090.055110.0009
state_identifier_array0.00130.080820.0006
Override
Cache load0.00240.1508830.0000
Sytem overhead
Fetch class attribute can translate value0.00150.097250.0003
Fetch class attribute name0.00180.1119180.0001
XML
Image XML parsing0.00210.130050.0004
class_abstraction
Instantiating content class attribute0.00010.0032250.0000
General
dbfile0.00350.2166410.0001
String conversion0.00000.000630.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
10content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
15content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
25content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/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: 65
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs