Skip to content

Commit

Permalink
Fix initialization of installation log
Browse files Browse the repository at this point in the history
  • Loading branch information
agapetry committed Oct 25, 2023
1 parent bca28f4 commit 6368947
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classes/PublishPress/PermissionsHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand Down

0 comments on commit 6368947

Please sign in to comment.