Skip to content

Commit

Permalink
Merge pull request #579 from patrickallaert/EZP-20373
Browse files Browse the repository at this point in the history
EZP-20373: ezcontentobject_tree.path_identification_string is not updated upon move or rename
  • Loading branch information
patrickallaert committed Apr 3, 2013
2 parents c0b443d + e2863ac commit 3a68e8a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions kernel/classes/ezcontentobjecttreenode.php
Expand Up @@ -3593,6 +3593,22 @@ function updatePathIdentificationString( $pathIdentificationName )
$pathIdentificationString = $pathIdentificationName;
if ( $this->attribute( 'path_identification_string' ) != $pathIdentificationString )
{
$db = eZDB::instance();
$db->query(
"UPDATE ezcontentobject_tree " .
"SET path_identification_string = " .
$db->concatString(
array(
"'" . $db->escapeString( $pathIdentificationString ) . "'",
$db->subString(
"path_identification_string",
mb_strlen( $this->attribute( 'path_identification_string' ) ) + 1
)
)
) . " " .
"WHERE path_string LIKE '{$this->attribute( 'path_string' )}_%'"
);

$this->setAttribute( 'path_identification_string', $pathIdentificationString );
$this->sync();
}
Expand Down Expand Up @@ -4199,6 +4215,16 @@ function move( $newParentNodeID, $nodeID = 0 )
$moveQuery1 = "UPDATE
ezcontentobject_tree
SET
path_identification_string = " .
$db->concatString(
array(
"'" . $db->escapeString( $newParentNode->PathIdentificationString ) . "'",
$db->subString(
"path_identification_string",
mb_strlen( $node->PathIdentificationString ) + 1
)
)
) . ",
path_string = $newPathString,
depth = depth + $newParentDepth - $oldDepth + 1
WHERE
Expand Down

0 comments on commit 3a68e8a

Please sign in to comment.