Fatal error when saving activity

Fatal error when saving activity

by Daniela Lofaro -
Number of replies: 4

I've been trying to create a new activity part of a course, and when I click on either 'save' option at the bottom, I get a blank page. I enable debugging and saw this message. The version I have installed in moodle is 'Face-to-face 2.8.0 (Build: 2015021300)'

Fatal error: Call to undefined function facetoface_instance_created() in "mod/facetoface/classes/observer.php on line 80"


Help would be greatly appeciated as I am on a deadline, thanks.

Average of ratings: -
In reply to Daniela Lofaro

Re: Fatal error when saving activity

by Daniela Lofaro -

this is the line where the error is supposedly at

facetoface_instance_created($event->get_context(), $forum);

In reply to Daniela Lofaro

Re: Fatal error when saving activity

by Rob Skeet -

I just installed this plugin and got the same error.

Anybody know why?

Help!

In reply to Daniela Lofaro

Re: Fatal error when saving activity

by Rob Skeet -

I just installed this plugin and got the same error.

Anybody know why?

Help!


In reply to Rob Skeet

Re: Fatal error when saving activity

by Josh Willcock -
Picture of Core developers Picture of Plugin developers

This is due to a new function which does not exist yet. This has been patched in SOME branches of the plugin but not the master branch...


Basically in order to resolve this, go into facetoface\classes\observer.php


and delete everything after line 64 leaving ONE '}' at the end to close the class

Basically this bit should be removed:


    /**

     * Observer for \core\event\course_module_created event.

     *

     * @param \core\event\course_module_created $event

     * @return void

     */

    public static function course_module_created(\core\event\course_module_created $event) {

        global $CFG;


        if ($event->other['modulename'] === 'facetoface') {


            // Include the Face-to-Face library to make use of the facetoface_instance_created function.

            require_once($CFG->dirroot . '/mod/facetoface/lib.php');


            $facetoface = $event->get_record_snapshot('facetoface', $event->other['instanceid']);

            facetoface_instance_created($event->get_context(), $forum);

        }

    }


Hope this helps