Removing a node

Author Message

Eirik Alfstad Johansen

Wednesday 18 August 2004 5:20:47 am

Hi guys,

I have written an event type extension that is supposed to remove the main node of an object after having created several more nodes for this object, one of which is a new main.

The code I use to try and accomplish is as follows:

// remove temp node profiles
			eZNodeAssignment::remove(128, $object['id']);
			
			// publish the object
			$operationResult = eZOperationHandler::execute( 'content', 
			                                                'publish',
			                                                array( 'object_id' => $object['id'],
			                                                       'version' => $object['current_version']) );

This does remove the node from the eznode_assignment table in the database, but it still shows up as a child node of node 128 on the web site.

Am I missing a step?

Thanks in advance !

Sincerely,

Eirik Johansen
http://www.netmaking.no/

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Eirik Alfstad Johansen

Wednesday 25 August 2004 12:54:12 am

Bump.

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Hans Melis

Wednesday 25 August 2004 1:11:29 am

Hi Eirik,

It's been a while since I've written some PHP code that removes nodes, but I just did a quick check of the old code and compared to the newest version in the ezp kernel classes.

I think you should fetch the node object ( eZContentObjectTreeNode::fetch() ) and then call the remove() function on that object.

Hans
http://blog.hansmelis.be

Eirik Alfstad Johansen

Wednesday 25 August 2004 3:06:02 am

Worked like a charm, Hans. Thanks a lot!

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

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 03:35:07
Script start
Timing: Jan 19 2025 03:35:07
Module start 'layout'
Timing: Jan 19 2025 03:35:07
Module start 'content'
Timing: Jan 19 2025 03:35:09
Module end 'content'
Timing: Jan 19 2025 03:35:09
Script end

Main resources:

Total runtime1.3627 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0313152.6094
Module start 'layout' 0.00640.0033 741.640639.4141
Module start 'content' 0.00971.3513 781.0547552.7344
Module end 'content' 1.36110.0016 1,333.789112.1953
Script end 1.3626  1,345.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2419160.0002
Check MTime0.00130.0949160.0001
Mysql Total
Database connection0.00100.075510.0010
Mysqli_queries1.294094.9573600.0216
Looping result0.00080.0599580.0000
Template Total1.328497.520.6642
Template load0.00180.133020.0009
Template processing1.326697.352820.6633
Template load and register function0.00010.008510.0001
states
state_id_array0.00110.078310.0011
state_identifier_array0.00230.167820.0011
Override
Cache load0.00150.1083250.0001
Sytem overhead
Fetch class attribute can translate value0.00070.049620.0003
Fetch class attribute name0.00110.082860.0002
XML
Image XML parsing0.01451.065520.0073
class_abstraction
Instantiating content class attribute0.00000.001080.0000
General
dbfile0.01431.0503210.0007
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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/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
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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