Error using eZContentObjectTreeNode::fetchByURLPath (can't access node)

Author Message

Damien MARTIN

Wednesday 29 December 2010 12:49:04 am

Hi there,

I have a problem with a little piece of code :

$content = eZContentObjectTreeNode::fetchByURLPath( $chemin_reel ) ;

For the following content tree :

Root
 `- Annonces
   |- Un dossier
   | `- Une annonce 1
   |- Un autre dossier
   | |- Une annonce 2
   | `- Une annonce 3
   `- Une annonce 

I want to get the folders : "Annonces", "Annonce/Un dossier" and "Annonces/Un autre dossier".

When I fetch with $chemin_reel = 'Annonces'; it works.
Bit if I want to fetch with $chemin_reel = 'Annonces/Un-dossier'; (wich is the name in the URL in administration panel), it doesn't work.

I don't understand why the first node return the correct object and why the others nodes don't.

Could someone explain me ?

Thanks Damien

Carlos Revillo

Wednesday 29 December 2010 6:17:52 am

Hi there. If you take a look at the code you will see this function uses path_identification_string for getting the node

http://pubsvn.ez.no/doxygen/trunk/html/ezcontentobjecttreenode_8php_source.html#l02867

to be brief, path_identification_string is a field of ezcontentobjecttreenode table. have a look at that table with phpmyadmin or something and you will see that none of the records has 'Annonces/Un-dossier' for this field. probably they will have something like 'Annonces/Un_dossier'...Note the underscore instead of the dash.

hope this give you a hint :).

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 03:00:57
Script start
Timing: Jan 18 2025 03:00:57
Module start 'layout'
Timing: Jan 18 2025 03:00:57
Module start 'content'
Timing: Jan 18 2025 03:00:58
Module end 'content'
Timing: Jan 18 2025 03:00:58
Script end

Main resources:

Total runtime0.6253 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.6328152.6563
Module start 'layout' 0.00510.0024 742.289139.5000
Module start 'content' 0.00750.6168 781.7891500.2813
Module end 'content' 0.62420.0010 1,282.07038.4063
Script end 0.6252  1,290.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5478160.0002
Check MTime0.00130.2062160.0001
Mysql Total
Database connection0.00070.106510.0007
Mysqli_queries0.584793.5184540.0108
Looping result0.00040.0588520.0000
Template Total0.602796.420.3014
Template load0.00180.286720.0009
Template processing0.600996.109320.3005
Template load and register function0.00010.012510.0001
states
state_id_array0.00080.126410.0008
state_identifier_array0.00060.089420.0003
Override
Cache load0.00150.2467230.0001
Sytem overhead
Fetch class attribute can translate value0.00040.071020.0002
Fetch class attribute name0.00100.165430.0003
XML
Image XML parsing0.00050.080520.0003
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00070.1070160.0000
String conversion0.00000.001140.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/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/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 9

Time used to render debug report: 0.0001 secs