Quantcast
Channel: Installing and upgrading help
Viewing all articles
Browse latest Browse all 47324

Re: Moodle uprade from 2.5.8 to 2.7.3 - error message: course modules availablility does not exist.

$
0
0
by byron catechis.  

Dear Ken,

thank you for the suggestion, the only backup I use is the one for all my websites on the server, and will not be able to access the last version until Monday...

Have access on the server "backend" to moodle/availability/classes/info_module.php

I have found the following code... am not sure if I am in the right place...


namespace core_availability;

defined('MOODLE_INTERNAL') || die();

/**
 * Class handles conditional availability information for an activity.
 *
 * @package core_availability
 * @copyright 2014 The Open University
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class info_module extends info {
    /** @var \cm_info Activity. */
    protected $cm;

    /**
     * Constructs with item details.
     *
     * @param \cm_info $cm Course-module object
     */
    public function __construct(\cm_info $cm) {
        parent::__construct($cm->get_course(), $cm->visible, $cm->availability);
        $this->cm = $cm;
    }

    protected function get_thing_name() {
        // We cannot access $cm->name as a property at this point, because this
        // code may itself run in response to the $cm->name property access, and
        // PHP magic function properties do not allow recursion (because PHP).
        return '<AVAILABILITY_CMNAME_' . $this->cm->id . '/>';
    }

    protected function set_in_database($availability) {
        global $DB;
        $DB->set_field('course_modules', 'availability', $availability,
                array('id' => $this->cm->id));
    }

    /**
     * Gets the course-module object. Intended for use by conditions.
     *
     * @return \cm_info Course module
     */
    public function get_course_module() {
        return $this->cm;
    }

    public function get_context() {
        return \context_module::instance($this->cm->id);
    }

P.S. I have only copied and pasted the first part of the code... let me know if I can "bypass" the problem here... thank you (am attaching the info_module.php file

Byron


Viewing all articles
Browse latest Browse all 47324

Trending Articles