diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-04-19 14:44:32 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-04-19 14:44:32 +0000 |
| commit | 520df873fef29c1faf89a2cba513bb62fde6cd81 (patch) | |
| tree | e15cced973dc3182d5a8ffd28acef9d97829743d /lib/classes/JsonApi/Routes/Courseware/StructuralElementsUpdate.php | |
| parent | d1055fa62ae5066ae01618c7cbf90105cb754b65 (diff) | |
fix changes to method signature, fixes #2564
Closes #2564
Merge request studip/studip!1730
Diffstat (limited to 'lib/classes/JsonApi/Routes/Courseware/StructuralElementsUpdate.php')
| -rw-r--r-- | lib/classes/JsonApi/Routes/Courseware/StructuralElementsUpdate.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/classes/JsonApi/Routes/Courseware/StructuralElementsUpdate.php b/lib/classes/JsonApi/Routes/Courseware/StructuralElementsUpdate.php index 33ba9a3..febe3cc 100644 --- a/lib/classes/JsonApi/Routes/Courseware/StructuralElementsUpdate.php +++ b/lib/classes/JsonApi/Routes/Courseware/StructuralElementsUpdate.php @@ -39,7 +39,7 @@ class StructuralElementsUpdate extends JsonApiController /** * @SuppressWarnings(PHPMD.UnusedFormalParameters) */ - protected function validateResourceDocument($json, $resource) + protected function validateResourceDocument($json, $data) { if (!self::arrayHas($json, 'data')) { return 'Missing `data` member at document´s top level.'; @@ -55,7 +55,7 @@ class StructuralElementsUpdate extends JsonApiController if (self::arrayHas($json, 'data.relationships.parent')) { // Sonderfall: Wurzel hat kein parent und kann auch nicht verändert werden - if ($resource->isRootNode()) { + if ($data->isRootNode()) { if (null !== self::arrayGet($json, 'data.relationships.parent.data')) { return 'Cannot modify `parent` of a root node.'; } @@ -70,7 +70,7 @@ class StructuralElementsUpdate extends JsonApiController // keine Schleifen if ( in_array( - $resource->id, + $data->id, array_merge( [$parent->id], array_map(function ($ancestor) { |
