bdaloukas / moodle-mod_game

moodle-mod_game
GNU General Public License v3.0
15 stars 41 forks source link

duplicate require causing error during upgrade #27

Closed ilyatregubov closed 5 years ago

ilyatregubov commented 5 years ago

There are 2 appearances of require( 'importsnakes.php'); in upgrade.php, so if version was < 2018060404 upgrade will fail with the error

PHP Fatal error: Cannot redeclare game_importsnakes() (previously declared in /siteroot/mod/game/db/importsnakes.php:33) in /siteroot/mod/game/db/importsnakes.php on line 72 PHP Stack trace: PHP 1. {main}() /siteroot/admin/cli/upgrade.php:0 PHP 2. upgrade_noncore() /siteroot/admin/cli/upgrade.php:182 PHP 3. upgrade_plugins() /siteroot/lib/upgradelib.php:1857 PHP 4. upgrade_plugins_modules() /siteroot/lib/upgradelib.php:512 PHP 5. xmldb_game_upgrade() /siteroot/lib/upgradelib.php:806

But it will pass on second run since it reached savepoint after first appearance

bdaloukas commented 5 years ago

Thanks. I fixed it.