5.6.2.1 Upgrade and event handlers
Permalink
I just updated my oldest PRB test site to 5.6.2.1 (ie most bloated with addons that probably have issues because they are pre-release and unmaintained).
I got several errors during the upgrade from addons with event handlers in the package controllers for on_before_render and on_render_complete, where the page object was not set during the upgrade.
I added some early returns from the handlers, the upgrade completed, I removed the early returns and everything works fine again. So the only issue was during the actual upgrade.
Anyway, for anyone upgrading to 5.6.2.1, I suggest either:
A: Temporarily uninstall any addon with the above event handlers in the package controller.
Or
B: Hack the code for the package controllers to add early returns to the above event handlers, just temporarily while the upgrade completes.
A note for package developers. Never trust the page object. After getting it always test it is an actual object and returns a valid page (ie not an error) before trying to do anything with it.
I got several errors during the upgrade from addons with event handlers in the package controllers for on_before_render and on_render_complete, where the page object was not set during the upgrade.
I added some early returns from the handlers, the upgrade completed, I removed the early returns and everything works fine again. So the only issue was during the actual upgrade.
Anyway, for anyone upgrading to 5.6.2.1, I suggest either:
A: Temporarily uninstall any addon with the above event handlers in the package controller.
Or
B: Hack the code for the package controllers to add early returns to the above event handlers, just temporarily while the upgrade completes.
A note for package developers. Never trust the page object. After getting it always test it is an actual object and returns a valid page (ie not an error) before trying to do anything with it.