Skip to content

Commit

Permalink
Merge remote-tracking branch 'troll/MAGETWO-47746' into MAGETWO-48042
Browse files Browse the repository at this point in the history
  • Loading branch information
vzabaznov committed Jan 21, 2016
2 parents 03f436f + 349fd4b commit fa80010
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/code/Magento/Catalog/Controller/Adminhtml/Category/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ public function execute()
if ($storeId) {
$categoryId = (int)$this->storeManager->getStore($storeId)->getRootCategoryId();
} else {
$categoryId = (int)$this->storeManager->getDefaultStoreView()->getRootCategoryId();
$defaultStoreView = $this->storeManager->getDefaultStoreView();
if ($defaultStoreView) {
$categoryId = (int)$defaultStoreView->getRootCategoryId();
} else {
$stores = $this->storeManager->getStores();
if (count($stores)) {
$store = reset($stores);
$categoryId = (int)$store->getRootCategoryId();
}
}
}
$this->getRequest()->setParam('id', $categoryId);
}
Expand Down

0 comments on commit fa80010

Please sign in to comment.