From 08da2b0b8123cd04c82d7b6746f1fdc963b1c10d Mon Sep 17 00:00:00 2001 From: Peter Soots Date: Tue, 21 Jul 2015 18:38:27 -0700 Subject: [PATCH] Ensuring version order of database histroy. --- modules/system/classes/VersionManager.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/system/classes/VersionManager.php b/modules/system/classes/VersionManager.php index 995be302a..13b34e973 100644 --- a/modules/system/classes/VersionManager.php +++ b/modules/system/classes/VersionManager.php @@ -391,6 +391,12 @@ class VersionManager } $historyInfo = Db::table('system_plugin_history')->where('code', $code)->get(); + + if (is_array($historyInfo)) { + usort($historyInfo, function ($a, $b) { + return version_compare($a->version, $b->version); + }); + } return $this->databaseHistory[$code] = $historyInfo; }