diff --git a/src/Elements/Bundle/AlternateObjectTreesBundle/Resources/public/js/config/panel.js b/src/Elements/Bundle/AlternateObjectTreesBundle/Resources/public/js/config/panel.js index a8979d5..9ac8655 100644 --- a/src/Elements/Bundle/AlternateObjectTreesBundle/Resources/public/js/config/panel.js +++ b/src/Elements/Bundle/AlternateObjectTreesBundle/Resources/public/js/config/panel.js @@ -200,8 +200,8 @@ pimcore.plugin.alternateObjectTrees.config.panel = Class.create({ } Ext.Ajax.request({ - url: "/admin/elements-alternate-object-trees/admin/alternate-object-tree", - method: "POST" + url: "/admin/elements-alternate-object-trees/alternate-object-tree", + method: "POST", params: { name: value }, diff --git a/src/Elements/Bundle/AlternateObjectTreesBundle/Service.php b/src/Elements/Bundle/AlternateObjectTreesBundle/Service.php index 150dd2c..de1b73a 100644 --- a/src/Elements/Bundle/AlternateObjectTreesBundle/Service.php +++ b/src/Elements/Bundle/AlternateObjectTreesBundle/Service.php @@ -62,12 +62,14 @@ public function getTreeId() { */ public function getLevelDefinitionByLevel($level) { - $levelDefinition = $this->levelDefinitions[$level - 1]; - $class = $this->getClass(); - if ($levelDefinition && $class) { - $levelDefinitionClass = 'Elements\\Bundle\\AlternateObjectTreesBundle\\LevelDefinition\\'.ucfirst($levelDefinition['type']); + if(array_key_exists($level - 1, $this->levelDefinitions)) { + $levelDefinition = $this->levelDefinitions[$level - 1]; + $class = $this->getClass(); + if ($levelDefinition && $class) { + $levelDefinitionClass = 'Elements\\Bundle\\AlternateObjectTreesBundle\\LevelDefinition\\' . ucfirst($levelDefinition['type']); - return new $levelDefinitionClass($class, $levelDefinition['config']); + return new $levelDefinitionClass($class, $levelDefinition['config']); + } } return null;