From 636894785e2cabe11956c8fb1f46db215034cef1 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:32:11 -0400 Subject: [PATCH] Fix initialization of installation log --- classes/PublishPress/PermissionsHooks.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/PublishPress/PermissionsHooks.php b/classes/PublishPress/PermissionsHooks.php index 8e97e6ac..106ef420 100644 --- a/classes/PublishPress/PermissionsHooks.php +++ b/classes/PublishPress/PermissionsHooks.php @@ -267,14 +267,15 @@ public function actInit() $ver_history = (array) json_decode($ver_history); } else { // Initiate version history log with the last stored version (Pro or Free) + $ver_history = []; if (defined('PRESSPERMIT_PRO_VERSION') && !empty($prev_pro_version)) { - $ver_history = [(object) ['version' => $prev_pro_version, 'date' => '', 'isPro' => true]]; + $ver_history [] = (object) ['version' => $prev_pro_version, 'date' => '', 'isPro' => true]; } // In case last Pro version is an irrelevant old entry, also include last Core version if it's higher if ($prev_core_version && (!defined('PRESSPERMIT_PRO_VERSION') || version_compare($prev_core_version, $prev_pro_version, '>'))) { - $ver_history = [(object) ['version' => $prev_core_version, 'date' => '', 'isPro' => false]]; + $ver_history [] = (object) ['version' => $prev_core_version, 'date' => '', 'isPro' => false]; } }