Skip to content

Commit

Permalink
Fix "argument must be of type array|object, null given"
Browse files Browse the repository at this point in the history
Further improved the menus.
  • Loading branch information
blackcoder87 committed Nov 26, 2023
1 parent b5fe6cc commit 2e150af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions application/modules/link/controllers/admin/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function treatLinkAction()
if ($this->getRequest()->getParam('id')) {
$this->getLayout()->getAdminHmenu()
->add($this->getTranslator()->trans('menuLinks'), ['action' => 'index'])
->add($this->getTranslator()->trans('edit'), ['action' => 'treat']);
->add($this->getTranslator()->trans('menuActionEditLink'), ['action' => 'treat']);

$model = $linkMapper->getLinkById($this->getRequest()->getParam('id'));

Expand All @@ -193,7 +193,7 @@ public function treatLinkAction()
} else {
$this->getLayout()->getAdminHmenu()
->add($this->getTranslator()->trans('menuLinks'), ['action' => 'index'])
->add($this->getTranslator()->trans('add'), ['action' => 'treat']);
->add($this->getTranslator()->trans('menuActionNewLink'), ['action' => 'treat']);
}
$this->getView()->set('link', $model);

Expand Down Expand Up @@ -243,7 +243,7 @@ public function treatLinkAction()
}
}

$this->getView()->set('cats', $categoryMapper->getCategories());
$this->getView()->set('cats', $categoryMapper->getCategories() ?? []);
}

public function treatCatAction()
Expand All @@ -254,7 +254,7 @@ public function treatCatAction()
if ($this->getRequest()->getParam('id')) {
$this->getLayout()->getAdminHmenu()
->add($this->getTranslator()->trans('menuLinks'), ['action' => 'index'])
->add($this->getTranslator()->trans('edit'), ['action' => 'treat']);
->add($this->getTranslator()->trans('menuActionEditCategory'), ['action' => 'treat']);

$model = $categorykMapper->getCategoryById($this->getRequest()->getParam('id'));

Expand All @@ -264,7 +264,7 @@ public function treatCatAction()
} else {
$this->getLayout()->getAdminHmenu()
->add($this->getTranslator()->trans('menuLinks'), ['action' => 'index'])
->add($this->getTranslator()->trans('add'), ['action' => 'treat']);
->add($this->getTranslator()->trans('menuActionNewCategory'), ['action' => 'treat']);
}
$this->getView()->set('category', $model);

Expand Down
2 changes: 1 addition & 1 deletion application/modules/link/translations/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'description' => 'Beschreibung',
'noLinks' => 'Keine Links vorhanden',
'noCategory' => 'Keine Kategorie vorhanden',
'httpOrMedia' => 'http:// oder Medien',
'httpOrMedia' => 'https:// oder Medien',
'deleteFailed' => 'Es befinden sich noch Einträge in der Kategorie',
'linkInfoText' => 'Die Links einer Kategorie können innerhalb der Kategorie bearbeitet werden. Links und Kategorien können durch ziehen und ablegen sortiert werden.',
'categoryNotFound' => 'Kategorie nicht gefunden.',
Expand Down
2 changes: 1 addition & 1 deletion application/modules/link/translations/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'description' => 'Description',
'noLinks' => 'No links',
'noCategory' => 'No category',
'httpOrMedia' => 'http:// or Media',
'httpOrMedia' => 'https:// or Media',
'deleteFailed' => 'There are still entries in the category',
'linkInfoText' => 'The links of a category can be edited inside the category. Links and categories can be sorted by drag and drop.',
'categoryNotFound' => 'Category not found.',
Expand Down

0 comments on commit 2e150af

Please sign in to comment.