Skip to content

Commit

Permalink
Merge branch '2017.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Aug 22, 2018
2 parents 870ffa1 + c9af39b commit ad17157
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 5 additions & 2 deletions kernel/classes/ezcontentobjecttreenode.php
Expand Up @@ -2796,7 +2796,7 @@ static function sortArrayBySortFieldAndSortOrder( $sortField, $sortOrder )
\note Transaction unsafe. If you call several transaction unsafe methods you must enclose
the calls within a db transaction; thus within db->begin and db->commit.
*/
static function assignSectionToSubTree( $nodeID, $sectionID, $oldSectionID = false )
static function assignSectionToSubTree( $nodeID, $sectionID, $oldSectionID = false, $updateSearchIndexes = true )
{
$db = eZDB::instance();
$node = eZContentObjectTreeNode::fetch( $nodeID );
Expand Down Expand Up @@ -2827,7 +2827,10 @@ static function assignSectionToSubTree( $nodeID, $sectionID, $oldSectionID = fal
foreach ( array_chunk( $objectSimpleIDArray, 100 ) as $pagedObjectIDs )
{
$db->query( "UPDATE ezcontentobject SET section_id='$sectionID' WHERE $filterPart " . $db->generateSQLINStatement( $pagedObjectIDs, 'id', false, true, 'int' ) );
eZSearch::updateObjectsSection( $pagedObjectIDs, $sectionID );
if ( $updateSearchIndexes )
{
eZSearch::updateObjectsSection( $pagedObjectIDs, $sectionID );
}
}
$db->commit();

Expand Down
2 changes: 1 addition & 1 deletion kernel/classes/ezsection.php
Expand Up @@ -240,7 +240,7 @@ public function applyTo( eZContentObject $object )
{
foreach ( $assignedNodes as $node )
{
eZContentOperationCollection::updateSection( $node->attribute( "node_id" ), $sectionID );
eZContentOperationCollection::updateSection( $node->attribute( "node_id" ), $sectionID, false );
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions kernel/content/ezcontentoperationcollection.php
Expand Up @@ -1152,12 +1152,13 @@ static public function swapNode( $nodeID, $selectedNodeID, $nodeIdList = array()
*
* @param int $nodeID
* @param int $selectedSectionID
* @param bool $updateSearchIndexes
*
* @return array An array with operation status, always true
* @return void
*/
static public function updateSection( $nodeID, $selectedSectionID )
static public function updateSection( $nodeID, $selectedSectionID, $updateSearchIndexes = true )
{
eZContentObjectTreeNode::assignSectionToSubTree( $nodeID, $selectedSectionID );
eZContentObjectTreeNode::assignSectionToSubTree( $nodeID, $selectedSectionID, false, $updateSearchIndexes );
}

/**
Expand Down

0 comments on commit ad17157

Please sign in to comment.