Skip to content

Commit

Permalink
Fix EZP-24754: PHP Notice while erasing content
Browse files Browse the repository at this point in the history
While erasing content in some cases PHP message: PHP Notice: Undefined offset: 0 in ezpublish_legacy/kernel/content/ezcontentoperationcollection.php

closes ezsystems#1198
  • Loading branch information
pedroresende authored and yannickroger committed Sep 4, 2015
1 parent 351f492 commit fbe65da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel/content/ezcontentoperationcollection.php
Expand Up @@ -874,8 +874,11 @@ static public function removeNodes( array $removeNodeIdList )
{
$allNodes = $objectIdList[$objectId]->assignedNodes();
// Registering node that will be promoted as 'main'
$mainNodeChanged[$objectId] = $allNodes[0];
eZContentObjectTreeNode::updateMainNodeID( $allNodes[0]->attribute( 'node_id' ), $objectId, false, $allNodes[0]->attribute( 'parent_node_id' ) );
if ( isset( $allNodes[0] ) )
{
$mainNodeChanged[$objectId] = $allNodes[0];
eZContentObjectTreeNode::updateMainNodeID( $allNodes[0]->attribute( 'node_id' ), $objectId, false, $allNodes[0]->attribute( 'parent_node_id' ) );
}
}

// Give other search engines that the default one a chance to reindex
Expand Down

0 comments on commit fbe65da

Please sign in to comment.