Skip to content
Snippets Groups Projects
Commit b83301f3 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

Revert "Resolve "Veranstaltungshierarchie: Fehler beim Anlegen von Unterelementen""

This reverts commit 704d702b.
parent 2e7e7191
No related branches found
No related tags found
No related merge requests found
...@@ -130,15 +130,12 @@ class Admin_TreeController extends AuthenticatedController ...@@ -130,15 +130,12 @@ 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'));
$children = $parent->getChildNodes(); $maxprio = max(array_map(
$maxprio = !empty($children) function ($c) {
? max(array_map( return $c->priority;
function ($c) { },
return $c->priority; $parent->getChildNodes()
}, ));
$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.
Please register or to comment