mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 19:58:53 +02:00
Fixed exception on visiting certain group edit pages.
This fixes issue #340
This commit is contained in:
parent
05d73d2f68
commit
b5c0f37f88
2 changed files with 16 additions and 9 deletions
|
@ -77,7 +77,8 @@ class TreeViewGenerator
|
|||
//When we use the newEdit type, add the New Element node.
|
||||
if ('newEdit' === $mode) {
|
||||
//Generate the url for the new node
|
||||
$href = $this->urlGenerator->createURL(new $class());
|
||||
//DO NOT try to create an object from the class, as this might be an proxy, which can not be easily initialized, so just pass the class_name directly
|
||||
$href = $this->urlGenerator->createURL($class);
|
||||
$new_node = new TreeViewNode($this->translator->trans('entity.tree.new'), $href);
|
||||
//When the id of the selected element is null, then we have a new element, and we need to select "new" node
|
||||
if (!$selectedElement instanceof AbstractDBElement || null === $selectedElement->getID()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue