Skip to content
Permalink
Browse files

Fix EZP-21563: Fatal error in eZContentUpload if no node

  • Loading branch information...
bdunogier committed Oct 4, 2013
1 parent 3608344 commit 7f3145ba239253b3a3353551e1621a5dbd68c2c4
Showing with 6 additions and 2 deletions.
  1. +6 −2 kernel/classes/ezcontentupload.php
@@ -771,8 +771,12 @@ function publishObject( &$result, &$errors, &$notices,
$mainNode = $object->mainNode();
$result['contentobject_main_node'] = $mainNode;
$result['contentobject_main_node_id'] = $mainNode->attribute( 'node_id' );
$this->setResult( array( 'node_id' => $mainNode->attribute( 'node_id' ),
// The published object may not have a node if publishing was interrupted
$mainNodeId = $mainNode ? $mainNode->attribute( 'node_id' ) : 0;
$result['contentobject_main_node_id'] = $mainNodeId;
$this->setResult( array( 'node_id' => $mainNodeId,
'object_id' => $object->attribute( 'id' ),
'object_version' => $publishVersion ) );

0 comments on commit 7f3145b

Please sign in to comment.
You can’t perform that action at this time.