{"action":"opened","issue":{"url":"https://api.github.com/repos/sulu/sulu/issues/2631","repository_url":"https://api.github.com/repos/sulu/sulu","labels_url":"https://api.github.com/repos/sulu/sulu/issues/2631/labels{/name}","comments_url":"https://api.github.com/repos/sulu/sulu/issues/2631/comments","events_url":"https://api.github.com/repos/sulu/sulu/issues/2631/events","html_url":"https://github.com/sulu/sulu/issues/2631","id":166293381,"number":2631,"title":"StructrueBridge::getParent() access invalid documentInspector property","user":{"login":"patkar","id":993350,"avatar_url":"https://avatars.githubusercontent.com/u/993350?v=3","gravatar_id":"","url":"https://api.github.com/users/patkar","html_url":"https://github.com/patkar","followers_url":"https://api.github.com/users/patkar/followers","following_url":"https://api.github.com/users/patkar/following{/other_user}","gists_url":"https://api.github.com/users/patkar/gists{/gist_id}","starred_url":"https://api.github.com/users/patkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patkar/subscriptions","organizations_url":"https://api.github.com/users/patkar/orgs","repos_url":"https://api.github.com/users/patkar/repos","events_url":"https://api.github.com/users/patkar/events{/privacy}","received_events_url":"https://api.github.com/users/patkar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-19T10:01:44Z","updated_at":"2016-07-19T10:01:44Z","closed_at":null,"body":"| Q | A\r\n| --- | ---\r\n| Bug? | yes\r\n| New Feature? | no\r\n| Sulu Version | 1.2.7 / `9a23d071`\r\n| Browser Version | -\r\n\r\n#### Actual Behavior\r\n\r\nIf i call `$structure->getParent()` in my custom template controller it wants to access the `documentInspector` which is not initialized and thus it tries to get it as a property from the page.\r\n\r\n```\r\n[1] InvalidArgumentException: Unknown child \"documentInspector\" in structure \"default\" loaded from: \"./app/Resources/pages/default.xml\". Children: \"highlight\", \"header\", \"teaser\", \"blocks\", \"info\"\r\n    at n/a\r\n        in ./vendor/sulu/sulu/src/Sulu/Component/Content/Metadata/ItemMetadata.php line 102\r\n\r\n    at Sulu\\Component\\Content\\Metadata\\ItemMetadata->getChild('documentInspector')\r\n        in ./vendor/sulu/sulu/src/Sulu/Component/Content/Compat/Structure/StructureBridge.php line 233\r\n\r\n    at Sulu\\Component\\Content\\Compat\\Structure\\StructureBridge->getProperty('documentInspector')\r\n        in ./vendor/sulu/sulu/src/Sulu/Component/Content/Compat/Structure/StructureBridge.php line 620\r\n\r\n    at Sulu\\Component\\Content\\Compat\\Structure\\StructureBridge->__get('documentInspector')\r\n        in ./vendor/sulu/sulu/src/Sulu/Component/Content/Compat/Structure/StructureBridge.php line 306\r\n\r\n    at Sulu\\Component\\Content\\Compat\\Structure\\StructureBridge->getParent()\r\n        in ./src/Client/Bundle/WebsiteBundle/Controller/WebsiteController.php line 28\r\n\r\n    at Client\\Bundle\\WebsiteBundle\\Controller\\WebsiteController->indexAction(object(PageBridge), false, false)\r\n```\r\n\r\n#### Expected Behavior\r\n\r\nIt should return the parent structure.\r\n\r\n#### Steps to Reproduce\r\n\r\nWith the following custom template controller:\r\n\r\n```php\r\n<?php\r\n\r\nnamespace Client\\Bundle\\WebsiteBundle\\Controller;\r\n\r\nuse Sulu\\Bundle\\WebsiteBundle\\Controller\\WebsiteController as BaseWebsiteController;\r\nuse Sulu\\Component\\Content\\Compat\\Structure\\PageBridge;\r\nuse Sulu\\Component\\Content\\Compat\\StructureInterface;\r\nuse Symfony\\Component\\HttpFoundation\\Response;\r\n\r\nclass WebsiteController extends BaseWebsiteController\r\n{\r\n    /**\r\n     * Loads the content from the request (filled by the route provider) and\r\n     * creates a response with this content and the appropriate cache headers.\r\n     *\r\n     * @param PageBridge $structure\r\n     * @param bool $preview\r\n     * @param bool $partial\r\n     *\r\n     * @return Response\r\n     */\r\n    public function indexAction(PageBridge $structure, $preview = false, $partial = false)\r\n    {\r\n        $response = $this->renderStructure(\r\n            $structure,\r\n            [\r\n                'parent' => $structure->getParent(),\r\n            ],\r\n            $preview,\r\n            $partial\r\n        );\r\n\r\n        return $response;\r\n    }\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"patkar"}}