Comment 8 for bug 1614805

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6888
Committed: https://git.mahara.org/mahara/mahara/commit/3a6fcfb94d0bcda49a3ca97524f4e5360a807495
Submitter: Son Nguyen (<email address hidden>)
Branch: 15.10_STABLE

commit 3a6fcfb94d0bcda49a3ca97524f4e5360a807495
Author: Aaron Wells <email address hidden>
Date: Fri Aug 19 15:04:27 2016 +1200

CLI upgrader, better handling of out-of-sequence plugin upgrades

Bug 1614805. When a plugin is installed "out of sequence" by a
call to plugin_upgrade in the core lib/db/upgrade.php file, the
AJAX-based web upgrader handles it gracefully, because it does
check_upgrade() before upgrading each plugin, detects the change
in status, and doesn't run the upgrade for that plugin a second
time.

The CLI upgrader, on the other hand, uses the same cached data
from check_upgrades() all the way through, causing it to re-run
upgrades for such plugins.

This patch makes it behave the same as the AJAX plugin, running
check_upgrade() again immediately before each component gets
upgraded. This does cause some redundancy in code execution,
but it shouldn't be enough to cause a noticeable performance hit.

Change-Id: Id5c431fc9e636df2cab05d22e6cc424271ce9f3d
behatnotneeded: Covered by existing tests
(cherry picked from commit 0e1704c1365bf372ee4a56cebe0785f130dc139e)