Skip to content
Snippets Groups Projects
Commit 3cecb32f authored by Thomas Hackl's avatar Thomas Hackl
Browse files

Resolve "Veranstaltungshierarchie: Fehler beim Anlegen von Unterelementen"

Closes #4257

Merge request studip/studip!3087
parent 92d476bf
No related branches found
No related tags found
No related merge requests found
...@@ -130,12 +130,15 @@ class Admin_TreeController extends AuthenticatedController ...@@ -130,12 +130,15 @@ class Admin_TreeController extends AuthenticatedController
$node->parent_id = Request::option('parent_id'); $node->parent_id = Request::option('parent_id');
$parent = $classname::getNode(Request::option('parent_id')); $parent = $classname::getNode(Request::option('parent_id'));
$maxprio = max(array_map( $children = $parent->getChildNodes();
function ($c) { $maxprio = !empty($children)
return $c->priority; ? max(array_map(
}, function ($c) {
$parent->getChildNodes() return $c->priority;
)); },
$children
))
: 0;
$node->priority = $maxprio + 1; $node->priority = $maxprio + 1;
if (Request::option('studip_object_id')) { if (Request::option('studip_object_id')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment