Backup errors

Backup errors

על ידי steven lyons בתאריך
מספר תגובות: 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?
ממוצע דרוגים: -
בתגובה ל: steven lyons

Re: Backup errors

על ידי Iñaki Arenaza בתאריך
תמונה של Core developers תמונה של Documentation writers תמונה של Particularly helpful Moodlers תמונה של Peer reviewers תמונה של 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.
בתגובה ל: Iñaki Arenaza

Re: Backup errors

על ידי 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
בתגובה ל: steven lyons

Re: Backup errors

על ידי Iñaki Arenaza בתאריך
תמונה של Core developers תמונה של Documentation writers תמונה של Particularly helpful Moodlers תמונה של Peer reviewers תמונה של 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 מעורב

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

Saludos. Iñaki.
בתגובה ל: Iñaki Arenaza

Re: Backup errors

על ידי 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.

בתגובה ל: steven lyons

Re: Backup errors

על ידי Iñaki Arenaza בתאריך
תמונה של Core developers תמונה של Documentation writers תמונה של Particularly helpful Moodlers תמונה של Peer reviewers תמונה של 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.
בתגובה ל: Iñaki Arenaza

Re: Backup errors

על ידי Iñaki Arenaza בתאריך
תמונה של Core developers תמונה של Documentation writers תמונה של Particularly helpful Moodlers תמונה של Peer reviewers תמונה של 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.