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.

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 01:19:46
Script start
Timing: Jan 19 2025 01:19:46
Module start 'layout'
Timing: Jan 19 2025 01:19:46
Module start 'content'
Timing: Jan 19 2025 01:19:47
Module end 'content'
Timing: Jan 19 2025 01:19:47
Script end

Main resources:

Total runtime0.9214 sec
Peak memory usage4,096.0000 KB
Database Queries97

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 593.0313152.6406
Module start 'layout' 0.00430.0024 745.671939.4766
Module start 'content' 0.00670.9133 785.1484769.5859
Module end 'content' 0.92000.0014 1,554.734429.3906
Script end 0.9214  1,584.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00270.2954160.0002
Check MTime0.00120.1275160.0001
Mysql Total
Database connection0.00070.072110.0007
Mysqli_queries0.823889.4070970.0085
Looping result0.00090.1012950.0000
Template Total0.894997.120.4475
Template load0.00200.212420.0010
Template processing0.892996.906420.4465
Template load and register function0.00010.011010.0001
states
state_id_array0.00100.108410.0010
state_identifier_array0.00120.127020.0006
Override
Cache load0.00180.2007830.0000
Sytem overhead
Fetch class attribute can translate value0.00060.069840.0002
Fetch class attribute name0.00140.1548180.0001
XML
Image XML parsing0.00170.183640.0004
class_abstraction
Instantiating content class attribute0.00000.0051250.0000
General
dbfile0.00170.1855300.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
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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 65
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs