[Koha-bugs] [Bug 22084] Plugin upgrade method and database plugin version storage will never be triggered for existing installs

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 8 19:32:37 CET 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22084

--- Comment #1 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 83726
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83726&action=edit
Bug 22084: Plugin upgrade method and database plugin version storage will never
be triggered for existing installs

If an existing plugin begins using the upgrade() method, it will never actually
get triggered because the installation has already occurred and no database
plugin version was stored at the time. Without that database version, the
upgrade method will never be triggered.

In addition, if the plugin has no upgrade method, the installed version is
never updated in the database!

Lastly, when an upgrade succeeds it prints a warning that the upgrade failed.

Test Plan:
1) Install an older version of the Kitchen sink plugin:
   *
https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.0/koha-plugin-kitchen-sink-v2.1.0.kpz
2) Delete the "__INSTALLED_VERSION__" key, and the "last_upgraded" key from
plugin_data for this plugin, to simulate having installed from an earlier
version of Koha
3) Upgrade to the latest version of the Kitchen sink plugin:
   *
https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.22/koha-plugin-kitchen-sink-v2.1.22.kpz
4) Note "__INSTALLED_VERSION__" still doesn't exist for the plugin, in the
plugin_data table
5) Apply this patch
6) Restart all the things
7) Browse to the Kitchen sink configuration page, this should trigger the
upgrade method
8) Note the "__INSTALLED_VERSION__" and "last_upgraded" keys exist in
plugin_data for the Kitchen Sink plugin

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list