From 5e884c495f4689a36768f2c604eaa5bce6589936 Mon Sep 17 00:00:00 2001 From: Dennis Reilard Date: Sun, 22 Oct 2023 17:44:47 +0200 Subject: [PATCH 1/3] Version Anpassung --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 579764754..43853fdbb 100644 --- a/index.php +++ b/index.php @@ -30,7 +30,7 @@ $serverTimeZone = @date_default_timezone_get(); date_default_timezone_set('UTC'); -define('VERSION', '2.1.53'); +define('VERSION', '2.1.54'); define('SERVER_TIMEZONE', $serverTimeZone); define('DEFAULT_MODULE', 'page'); define('DEFAULT_LAYOUT', 'index'); From 87144e543f48529d9d1817401b718af741964bc3 Mon Sep 17 00:00:00 2001 From: blackcoder87 Date: Mon, 23 Oct 2023 16:19:21 +0200 Subject: [PATCH 2/3] Forum: Fix error if there is no item to delete --- application/modules/forum/controllers/admin/Index.php | 6 +++++- application/modules/forum/mappers/Forum.php | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/application/modules/forum/controllers/admin/Index.php b/application/modules/forum/controllers/admin/Index.php index 8376a1a22..216597718 100644 --- a/application/modules/forum/controllers/admin/Index.php +++ b/application/modules/forum/controllers/admin/Index.php @@ -70,6 +70,7 @@ public function indexAction() 'title' => 'required', 'readAccess' => 'min:0', 'replyAccess' => 'min:0', + 'createAccess' => 'min:0', ]); if (!$validation->isValid()) { $this->addMessage($validation->getErrorBag()->getErrorMessages(), 'danger', true); @@ -83,7 +84,10 @@ public function indexAction() // Deletes old entries from database. if (!empty($oldItems)) { - $forumMapper->deleteItems(array_diff($oldItems, array_keys($items))); + $itemsToDelete = array_diff($oldItems, array_keys($items)); + if (!empty($itemsToDelete)) { + $forumMapper->deleteItems($itemsToDelete); + } } if ($items) { diff --git a/application/modules/forum/mappers/Forum.php b/application/modules/forum/mappers/Forum.php index 2c2f34007..56b5d176b 100644 --- a/application/modules/forum/mappers/Forum.php +++ b/application/modules/forum/mappers/Forum.php @@ -899,6 +899,10 @@ public function deleteItem(int $id) */ public function deleteItems(array $ids) { + if (empty($ids)) { + return; + } + $this->db()->delete('forum_items') ->where(['id' => $ids]) ->execute(); From 64df30c9aae37b6f205d1e5de54bfafd64cba53e Mon Sep 17 00:00:00 2001 From: blackcoder87 Date: Thu, 26 Oct 2023 18:18:45 +0200 Subject: [PATCH 3/3] Guestbook: Fix error when manually approving new entry --- .../modules/guestbook/config/config.php | 2 +- .../modules/guestbook/models/Entry.php | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/application/modules/guestbook/config/config.php b/application/modules/guestbook/config/config.php index 1f772338c..dc396f44e 100644 --- a/application/modules/guestbook/config/config.php +++ b/application/modules/guestbook/config/config.php @@ -10,7 +10,7 @@ class Config extends \Ilch\Config\Install { public $config = [ 'key' => 'guestbook', - 'version' => '1.13.0', + 'version' => '1.13.1', 'icon_small' => 'fa-solid fa-book', 'author' => 'Stantin, Thomas', 'link' => 'https://ilch.de', diff --git a/application/modules/guestbook/models/Entry.php b/application/modules/guestbook/models/Entry.php index 6aecec2f1..daeee86c4 100644 --- a/application/modules/guestbook/models/Entry.php +++ b/application/modules/guestbook/models/Entry.php @@ -70,9 +70,9 @@ public function getId(): ?int /** * Gets the email of the entry. * - * @return string + * @return string|null */ - public function getEmail(): string + public function getEmail(): ?string { return $this->email; } @@ -80,9 +80,9 @@ public function getEmail(): string /** * Gets the text of the entry. * - * @return string + * @return string|null */ - public function getText(): string + public function getText(): ?string { return $this->text; } @@ -90,9 +90,9 @@ public function getText(): string /** * Gets the name of the entry. * - * @return string + * @return string|null */ - public function getName(): string + public function getName(): ?string { return $this->name; } @@ -100,9 +100,9 @@ public function getName(): string /** * Gets the homepage of the entry. * - * @return string + * @return string|null */ - public function getHomepage(): string + public function getHomepage(): ?string { return $this->homepage; } @@ -110,9 +110,9 @@ public function getHomepage(): string /** * Gets the datetime of the entry. * - * @return string + * @return string|null */ - public function getDatetime(): string + public function getDatetime(): ?string { return $this->datetime; }