Backup errors

Backup errors

by steven lyons -
Number of replies: 7
I just noticed that automatic backup has stopped working. So I tried to do a manual backup and got these errors in the "Include Course Users" section of the Course Backup screen:
.............................................................................................

Include Course Users

Unknown column 'userfrom' in 'field list'

SELECT DISTINCT userfrom as id, 1 FROM mdl_message

Unknown table 'mc' in field list

SELECT DISTINCT mc.contactid as id,1 FROM mdl_message_contacts

users 20

.............................................................................................

Can anyone offer guidance on this?
Average of ratings: -
In reply to steven lyons

Re: Backup errors

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It seems it's a bug in .../moodle/message/lib.php. You have to edit that file, go to line 1030 (the line number is for 1.5.3+, your's may vary) and find the line that says:

if ($message_from_users = get_records_sql("SELECT DISTINCT userfrom as id, 1 FROM  {$CFG->prefix}message")) {

and change 'userfrom' with 'useridfrom'. Then look at line 1055, that says:

 if ($contact_to_users = get_records_sql("SELECT DISTINCT mc.contactid as id,1 FROM {$CFG->prefix}message_contacts")) {

and change 'mc.contactid' with 'contactid'.

That sould fix it.

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: Backup errors

by steven lyons -
Thanks, but that didn't work. Your suggested change stalled the backup completely with the following errors:

Include Course Users
Parse error: parse error in /var/www/vhosts/stevenlyons.org/httpdocs/message/lib.php on line 3

Fatal error: Call to undefined function: message_get_participants() in /var/www/vhosts/stevenlyons.org/httpdocs/backup/backuplib.php on line 155
In reply to steven lyons

Re: Backup errors

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hummm, you are getting an error on line 3 of message/lib.php, which in my copy of 1.5.3+ is an empty line. ???

I would restore the original file from a fresh original copy of it (from a backup or a download from download.moodle.org) and would do the edit again. You only have to change a couple of words inside existing strings, so this can't give PHP syntax errors mixed

Otherwise, you could attach your current message/lib.php here in a post and I would have a look at it.

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: Backup errors

by steven lyons -
Thanks again Inaki.

I am also using 1.5.3+ and have tried your suggested change twice now with the same effect.

file is attached.

In reply to steven lyons

Re: Backup errors

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I opened a bug and Penny L. has just fixed it in 1.5.3+ in CVS. If you are updating from CVS, the fix should be there. If you are updating from daily snapshots, the next build (tomorrow?) will include the fix.

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: Backup errors

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Have you tried the latest 1.5.3+? Penny L. is waiting for a confirmation that the fix is indeed working, before closing the bug.

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: Backup errors

by Penny Leach -
Steven - can you confirm this is fixed in the latest 1.5.3+ so we can close the bug report if it is?