Problem with reverse_related_objects fetch function

Author Message

Daniele Nocentini

Thursday 09 March 2006 2:59:23 am

I have strange problem with the reverse_related_objects fetch function, if I try to find a speficic product in my content structure with this code:

{def $objects=fetch( 'content', 'reverse_related_objects',
                     hash( 'object_id', 185,
                           'attribute_identifier', '279',
						   'limit', 1 ) )}
 
{foreach $objects as $object}
    {section show=$object.id|eq('1355')}
	{$object|attribute(show)} <br />
	{/section}
{/foreach}

otherwise if I try to find the same product with the node fetch function, this is my code:

{def $my_node=fetch( 'content', 'node', hash( 'node_id', 1147 ) )}
{$my_node|attribute(show)}

 

The problem is the data_map array, with the first method is empty instead with the second method contain 19 element.
It's a my code problem or it's a bug?

Antica Bottega Digitale srl
http://www.abd.it

Daniele Nocentini

Friday 10 March 2006 2:43:43 am

Please someone can Help me?

Antica Bottega Digitale srl
http://www.abd.it

Marc Boon

Friday 10 March 2006 8:41:14 am

In your first example, you fetch the reverse related objects of the object with object_id 185, and then only show something if the found object has id 1355.

In the second example you fetch a node with node_id 1147

They are two completely different things.
No wonder you get different results.

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

Main resources:

Total runtime1.1038 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 589.9297152.6563
Module start 'layout' 0.00500.0032 742.585939.4922
Module start 'content' 0.00821.0942 782.0781534.1563
Module end 'content' 1.10240.0014 1,316.234412.1250
Script end 1.1038  1,328.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2901160.0002
Check MTime0.00120.1119160.0001
Mysql Total
Database connection0.00080.072410.0008
Mysqli_queries1.058695.9040570.0186
Looping result0.00050.0443550.0000
Template Total1.074497.320.5372
Template load0.00180.161220.0009
Template processing1.072697.169520.5363
Template load and register function0.00010.007410.0001
states
state_id_array0.00090.080310.0009
state_identifier_array0.00120.107320.0006
Override
Cache load0.00150.1334190.0001
Sytem overhead
Fetch class attribute can translate value0.00080.072520.0004
Fetch class attribute name0.00110.098340.0003
XML
Image XML parsing0.00050.047920.0003
class_abstraction
Instantiating content class attribute0.00000.001250.0000
General
dbfile0.00080.0702160.0000
String conversion0.00000.000640.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs