mod_attendance upgrade gets stuck

Re: mod_attendance upgrade gets stuck

by C. C. -
Number of replies: 2
Hi Rafael,
When I try to upgrade to a later version:

Then:





Keeps loading about a minute...

And then stucks:



DEBUG is active, but don't show any error...

And then I refresh the page:  "Site is being upgraded, please retry later."

The same with other versions.

And this version 2016... don't work because several functions of php are deprecated.

In reply to C. C.

Re: mod_attendance upgrade gets stuck

by Rafael Monterroza -
Hi! I found something interesting that is potentially the main problem. I saw that your current version of the mod_attendance plugin is 2016031501, so I went to the upgrade path (https://github.com/danmarsden/moodle-mod_attendance/blob/master/db/upgrade.php) and started to read the steps that should be done to upgrade from that version. Line 175 is calling a function attendance_upgrade_create_calendar_events(); located in (https://github.com/danmarsden/moodle-mod_attendance/blob/master/db/upgradelib.php) which is doing a insertion to the DB in the table mdl_event. For what I see in there, that function was written back in the day, when the event table had less columns to be filled. If you are working with Moodle 3.7, that means $calevent object defined in line 38, lacks of properties that now are needed. That might be truncating the upgrade of the plugin because the insertions to the database are not succeeding. Do you have a way to verify that?
Recommended approach? That's tough. I see 2 possible ways: 1. If you confirm that the upgrade is failing because of those insertions, you can patch the attendance_upgrade_create_calendar_events(); to include the new fields of mdl_event table.
2. Do you have a back up of your site? If so, I suggest restoring the site and doing again the upgrade but gradually. E.G. upgrading Moodle from 2.6 to 3.0 then upgrade your community plugins also from 2.6 to 3.0 then upgrade Moodle from 3.0 to 3.7 and again the external plugins.
Average of ratings: Useful (2)
In reply to Rafael Monterroza

Re: mod_attendance upgrade gets stuck

by C. C. -
Rafael,
Thanks.
I did the 1* approach and it works.
Thank you, again sorriso