Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 4155c54

Browse files
committed
Merge pull request #152 from WouterJ/tostring-patch
Fixing Admin#toString when creating document
2 parents f5c79f7 + 7f25385 commit 4155c54

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Admin/AbstractMenuNodeAdmin.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,10 @@ public function setContentTreeBlock($contentTreeBlock)
157157

158158
public function toString($object)
159159
{
160-
return $object instanceof MenuNodeBase && $object->getLabel()
161-
? $object->getLabel()
162-
: parent::toString($object)
163-
;
160+
if ($object instanceof MenuNodeBase && $object->getLabel()) {
161+
return $object->getLabel();
162+
}
163+
164+
return $object instanceof Menu ? 'menu' : 'menu item';
164165
}
165166
}

0 commit comments

Comments
 (0)