Bad obj name when directly echo name after import

Author Message

Bin LIU

Tuesday 07 April 2009 2:28:23 am

Hi,
I do a ez import script.

function createObj(xxx)
{
    ......
    $object->store();
    $operationResult = eZOperationHandler :: execute('content', 'publish', array ('object_id' =>     $object->attribute('id'), 'version' => 1 ) );
    eZContentObject::clearCache();
    return $object;
}

And when I insert a new object class name TEST

$o = createObj(xxx);
echo $o->attribute('name'); 
echo $o->name();

it output "New TEST"

But if I do

$o = createObj(xxx);
$o1 = eZContentObject::fetch($o->attribute("id"));
echo $o1->attribute('name'); 
echo $o1->name();

It output the good name

Why ??
tks

 

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

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 10:17:42
Script start
Timing: Jan 18 2025 10:17:42
Module start 'layout'
Timing: Jan 18 2025 10:17:42
Module start 'content'
Timing: Jan 18 2025 10:17:43
Module end 'content'
Timing: Jan 18 2025 10:17:43
Script end

Main resources:

Total runtime1.2337 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.1719152.6406
Module start 'layout' 0.00470.0028 741.812539.4766
Module start 'content' 0.00751.2247 781.2891472.8438
Module end 'content' 1.23220.0015 1,254.13288.4375
Script end 1.2337  1,262.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2465160.0002
Check MTime0.00130.1051160.0001
Mysql Total
Database connection0.00070.054610.0007
Mysqli_queries1.189596.4205460.0259
Looping result0.00040.0326440.0000
Template Total1.204597.620.6023
Template load0.00180.147020.0009
Template processing1.202797.486520.6013
Template load and register function0.00020.019010.0002
states
state_id_array0.00100.079210.0010
state_identifier_array0.00100.079620.0005
Override
Cache load0.00150.1203190.0001
Sytem overhead
Fetch class attribute can translate value0.00170.136610.0017
Fetch class attribute name0.00140.116620.0007
XML
Image XML parsing0.00260.214210.0026
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00270.2197150.0002
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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs