Skip to content

Commit

Permalink
Gallery: Fix errors when trying to delete a category. (#705)
Browse files Browse the repository at this point in the history
Fix "key_exists(): Argument ($array) must be of type array, null given"
Fix "foreach() argument must be of type array|object, null given"
  • Loading branch information
blackcoder87 authored Jul 16, 2023
1 parent f101582 commit b66ff75
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions application/modules/gallery/controllers/admin/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ public function indexAction()
$galleryMapper = new GalleryMapper();
$imageMapper = new ImageMapper();

/*
* Saves the item tree to database.
*/
// Saves the item tree to database.
if ($this->getRequest()->isPost()) {
if ($this->getRequest()->getPost('save')) {
$sortItems = json_decode($this->getRequest()->getPost('hiddenMenu'));
$items = $this->getRequest()->getPost('items');
$items = $this->getRequest()->getPost('items') ?? [];

foreach ($items as $item) {
$validation = Validation::create($item, [
Expand Down

0 comments on commit b66ff75

Please sign in to comment.