warpwire / plugin-moodle

Warpwire Plugin for Moodle.
GNU General Public License v3.0
0 stars 2 forks source link

filter_warpwire can cause an exception during upgrade #3

Closed petermAprende closed 2 years ago

petermAprende commented 2 years ago

We have been getting errors like this:

-->theme_aprende
++ Éxito (0.24 segundos) ++
== Configurando los nuevos valores por defecto ==
Default exception handler: No puede ejecutarse durante la actualización Debug: 
Error code: cannotexecduringupgrade
* line 1445 of /lib/setuplib.php: moodle_exception thrown
* line 2158 of /lib/modinfolib.php: call to upgrade_ensure_not_running()
* line 37 of /filter/warpwire/filter.php: call to get_fast_modinfo()
* line 176 of /lib/filterlib.php: call to filter_warpwire->filter()
* line 218 of /lib/filterlib.php: call to filter_manager->apply_filter_chain()
* line 1326 of /lib/weblib.php: call to filter_manager->filter_text()
* line 252 of /admin/settings/plugins.php: call to format_text()
* line 8764 of /lib/adminlib.php: call to require()
* line 8790 of /lib/adminlib.php: call to admin_get_root()
* line 200 of /admin/cli/upgrade.php: call to admin_apply_default_settings()

!!! No puede ejecutarse durante la actualización !!!

` The problem is simple: get_fast_modinfo cannot be called during an upgrade. I created this PR to address the issue: https://github.com/warpwire/plugin-moodle/pull/2

It simply checks if an upgrade is in progress, and if so, it skips the filter.