Error: eZContentObject::fetch(): Object not found

Author Message

Dominik Pich

Thursday 18 December 2003 12:51:59 am

Why does this NOT work
{let menuitem=fetch('content', object, hash(object_id, 46))}
while this does:
{let children_count=fetch('content',list_count,hash(parent_node_id,46))

Olav Lillebø

Thursday 18 December 2003 1:54:44 am

Suggestion. If it is node_id 46 you are interested in, it's object_id is probably not 46. You can try {$node|attribute(show)}

 

Gunnstein Lye

Thursday 18 December 2003 2:38:56 am

Yup, nodes and objects are not the same. The object is the collection of attributes, and the node is a placement in the tree. They usually have different IDs. You can see the object id for instance in the edit link.

Dominik Pich

Thursday 18 December 2003 2:47:45 am

First, thank you both for your fast replies.
Ill check your solutions now.

One more question though... can object_ids and node_ids equal? For some IDs it even works.

Gunnstein Lye

Thursday 18 December 2003 2:54:57 am

Yes, they can be equal, but that's just coincidence.

Dominik Pich

Thursday 18 December 2003 3:16:11 am

//node_id used
{let menuitem=fetch('content', object, hash(object_id, 45))}
{node_view_gui view=menu content_node=$menuitem element_id="carlton" element_name="menu"}
{/let}

//object_id used
{let menuitem=fetch('content', object, hash(object_id, 42))}
{node_view_gui view=menu content_node=$menuitem element_id="carlton" element_name="menu"}
{/let}

// FOR THE ABOVE NODE_ID WORKS

in menu.tpl as called by node_view gui
$node.id = ID from above
{let children_count=fetch('content',list_count,hash(parent_node_id,$node.id))}
if node_id count > 0 else count == 0

Gunnstein Lye

Thursday 18 December 2003 4:04:18 am

When you use fetch('content', object, hash(object_id,xx)) then xx MUST be an object id.
When you use node_view_gui, you MUST supply a node. $menuitem is a content object in this case. This should work:
{node_view_gui view=menu content_node=$menuitem.main_node ...

fetch('content',list_count,hash(parent_node_id,$node.id))
$node.id will not work. Use $node_id or $node.node_id, depending on your template code.

Dominik Pich

Thursday 18 December 2003 4:27:51 am

The difference between a node and an object wasnt clear to me. I now use the func. 'node' to which I pass node_id and later on, $node.node_id

It isnt clear to me at all why some did work before but now all do.

Thank you

Balazs Halasy

Thursday 18 December 2003 4:35:12 am

Regarding the difference between objects and nodes, please read the docs:

http://ez.no/developer/ez_publish_3/documentation/ez_publish_basics/content_management_in_ez_publish/objects_nodes_and_the_content_node_tree

Balazs

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 16:04:37
Script start
Timing: Jan 18 2025 16:04:37
Module start 'layout'
Timing: Jan 18 2025 16:04:37
Module start 'content'
Timing: Jan 18 2025 16:04:38
Module end 'content'
Timing: Jan 18 2025 16:04:38
Script end

Main resources:

Total runtime0.9249 sec
Peak memory usage4,096.0000 KB
Database Queries79

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 588.0469152.6406
Module start 'layout' 0.00760.0034 740.687539.4766
Module start 'content' 0.01100.9125 780.1641649.2813
Module end 'content' 0.92350.0013 1,429.445316.1250
Script end 0.9249  1,445.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3530160.0002
Check MTime0.00130.1435160.0001
Mysql Total
Database connection0.00120.124410.0012
Mysqli_queries0.860993.0806790.0109
Looping result0.00080.0848770.0000
Template Total0.892996.520.4465
Template load0.00210.229620.0011
Template processing0.890896.311120.4454
Template load and register function0.00020.024710.0002
states
state_id_array0.00080.081310.0008
state_identifier_array0.00100.103720.0005
Override
Cache load0.00190.2037500.0000
Sytem overhead
Fetch class attribute can translate value0.00050.055440.0001
Fetch class attribute name0.00110.1214110.0001
XML
Image XML parsing0.00120.124840.0003
class_abstraction
Instantiating content class attribute0.00000.0034130.0000
General
dbfile0.00200.2166220.0001
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
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 34
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs