Make out-of-sequence plugin upgrades consistent in CLI upgrader & web upgrader
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Aaron Wells | ||
15.04 |
Fix Released
|
Medium
|
Aaron Wells | ||
15.10 |
Fix Released
|
Medium
|
Aaron Wells | ||
16.04 |
Fix Released
|
Medium
|
Aaron Wells | ||
16.10 |
Fix Released
|
Medium
|
Aaron Wells |
Bug Description
In Bug 1614298 there were some differences of behavior between the CLI upgrader and the web upgrader, due to how they handled the out-of-sequence installation of the module/webservices plugin. This plugin is installed in the core lib/db/upgrade.php file, by a call to plugin_upgrade(), in order to make sure it gets installed instead of leaving it as an optional user-initiated installation.
The CLI upgrader operates by running "check_upgrades()" at the beginning, which then looks at every component and plugin in Mahara to see which ones need to be upgraded. The return data includes the "installed" version number (retrieved from the database) and the "new" version number (from the version.php files on the filesystem). It then passes this data to "upgrade_
As a result, the webservices plugin was listed as needing upgrading, and then it got installed during the "core" upgrade step by the call to "upgrade_plugin()", and again by upgrade_mahara() when it looped through the listed plugins needing installation. The version number passed to the upgrade function by upgrade_mahara() was based on the initial call to check_upgrades() at the start of the script, causing the same upgrade block in the plugin's db/upgrade.php script to be executed twice.
The AJAX upgrader didn't have this problem, because it re-checks the status of each plugin before running the upgrade function for that plugin. First the parent script calls "check_plugins()" to find all the plugins that need to be upgraded. Then it sends a request to upgrade.json.php for each upgrade component. And then upgrade.json.php calls check_plugins() again. It does this in order to retrieve the full data about the plugin; but it has the side effect of preventing the double-upgrading of plugins that were upgraded or installed out of order by core.
It'd be best if both installation routes performed the same.
Changed in mahara: | |
milestone: | 16.10.0 → none |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Patch for "master" branch: https:/ /reviews. mahara. org/6872