Cannot backup courses with scheduler module

Cannot backup courses with scheduler module

by P A -
Number of replies: 5
Hi

I installed scheduler module version 2008030100 in Moodle 1.7+ and in 1.9. In both installations backup won't work anymore for courses that use this module:

Name: backup-tkp-20080311-1021.zip
  • Creating temporary structures
  • Deleting old data
  • Creating XML file
    • Writing header
    • Writing general info
    • Writing course data
    • Writing users info.
    • Writing categories and questions. .
    • Writing scales info
    • Writing groups info
    • Writing groupings info
    • Writing groupings-groups info
    • Writing events info
    • Writing gradebook info
    • Writing modules info
      • Forums
      • Labels
      • Lessons
      • Quizzes
      • Resources
      • Questionnaires
      • Schedulers

Backup just stops, without any error message.
Any ideas?

Patrick
Average of ratings: -
In reply to P A

Re: Cannot backup courses with scheduler module

by Valery Fremaux -

Catched :

add the line :

    include_once $CFG->dirroot."/mod/scheduler/locallib.php";

at start of backuplib.php in mod/scheduler.

In reply to Valery Fremaux

Re: Cannot backup courses with scheduler module

by P A -
Hi Valery

thanks for the fast reply. Backup works fine now but I can't restore the course. I've got this error message:

....Creating course modules
  • Forum "Nachrichtenforum"
  • Label ""
  • Lesson "testlektion"
  • Quiz "Test Test"
  • Quiz "spanish"
  • Resource "Moodle im Einsatz (Flash Player Demo)"
  • Scheduler "Neuer TEst mit Sprechzeit..."
The script stops when it comes to restore the scheduler.
Do I have to insert anything into restorelip.php?

Thanks a lot for your help
Patrick
In reply to P A

Re: Cannot backup courses with scheduler module

by Valery Fremaux -

I catch that tonight either !! (GMT) Thanks for testing. We cannot have an eye on everything !

Scheduler is a great module (I use it  extensively !!) and it will be soon "full implemented".

If you want your support have better tracking, you can use the Moodle Tracker (tracker.moodle.org) as front side, or the side-tracker in our project workspace : 

http://www.ethnoinformatique.fr/course/view.php?id=122&lang=en_utf8

Cheers.

In reply to P A

Re: Cannot backup courses with scheduler module

by Valery Fremaux -

Catched :

Indeed, you do need also need locallib.php in restore for the same reasons. I moved all module internal functions to locallib for API clarity, restorelib.php was not aware of that.

I found also a misnamed function §95

                    $status = scheduler_appointments_restore_mods ($mod->id, $newid, $info, $restore);

needs a 's'.

Finally, in case you use other modules from ethnoinformatique.fr, you moight protect the last function declaration in locallib.php, just like this.

/**
* adds an error css marker in case of matching error
* @param array $errors the current error set
* @param string $errorkey
*/
if (!function_exists('print_error_class')){
    function print_error_class($errors, $errorkeylist){
        if ($errors){
            foreach($errors as $anError){
                if ($anError->on == '') continue;
                if (preg_match("/\\b{$anError->on}\\b/" ,$errorkeylist)){
                    echo " class=\"formerror\" ";
                    return;
                }
            }       
        }
    }
}

this is I confess, an architectural irresolution of this module set, that used a redundant utility function in several modules, as we have no common "third-party" lib space that would be easily usable for making blind installs.

I checked that some data actually do not restore in the scheduler. I work on it before publishing next release.

I'll fix all this in release 8. 

I will add a little enhancement to release 8, that is, allowing to distribute grade and/or comment on all participants of the slot when grading the appointment. This would fasten operations when concluding a grouped meeting.

Cheers.