mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
accesslib:content_moved() fix bug in depth handling
the depth was getting a bit out-of-control when moving up the tree. Fix it...
This commit is contained in:
parent
a372aab507
commit
b4ab7f2ec9
1 changed files with 2 additions and 2 deletions
|
@ -4759,8 +4759,8 @@ function context_moved($context, $newparent) {
|
||||||
$newpath = $newparent->path . '/' . $context->id;
|
$newpath = $newparent->path . '/' . $context->id;
|
||||||
|
|
||||||
$setdepth = '';
|
$setdepth = '';
|
||||||
if ($newparent->depth +1 != $context->depth) {
|
if (($newparent->depth +1) != $context->depth) {
|
||||||
$setdepth = ", depth= depth + " . ($context->depth - $newparent->depth +1);
|
$setdepth = ", depth= depth + ({$newparent->depth} - {$context->depth}) + 1";
|
||||||
}
|
}
|
||||||
$sql = "UPDATE {$CFG->prefix}context
|
$sql = "UPDATE {$CFG->prefix}context
|
||||||
SET path='$newpath'
|
SET path='$newpath'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue