Missing important code?

Missing important code?

by Will Muenchow -
Number of replies: 7

I just tried to save my quiz and moodle is giving me this error.

This module is missing important code! (D:\Web Sites\MC Online/mod//lib.php

Continue

Any ideas?? I haven't done anything to the moodle files .

Average of ratings: -
In reply to Will Muenchow

Re: Missing important code?

by Will Muenchow -

Bump!

Anyone out there?

In reply to Will Muenchow

Re: Missing important code?

by Will Muenchow -

I'm guessing nodody else has received this error before? If that is the reason for the lack of response, I have another question. Because I can't figure out how to fix this problem and I'm running 1.3, how would I upgrade my quiz module (as this would be the only way to fix the problem I'm guessing?). Would I simply reupload an unziped quiz module from the 1.3 tgz I have, or should I upgrade the quiz module to a new version of moodle (1.3.1, 1.3.3 etc), and if I should do that, would I simply download the 1.3.3 version and use that quiz module as the quiz module on the download page is only good for 1.4 dev.

Looking forward to your responses!

In reply to Will Muenchow

Re: Missing important code?

by Art Lader -
Hi, Will,

Maybe upgrading the whole site to 1.4 dev would do the trick. Just unzip everything into a new folder, move config.php into the new folder and see if that helps...

Sorry if that is not a helpful response. I am just an enthusiastic end-user who "relies on the kindness of strangers" when I have a Moodle problem.

-- Art
In reply to Art Lader

Re: Missing important code?

by Will Muenchow -
I would love to install 1.4 but its only dev and we are running a production server with many students who are half way into their semester. Like you, I'm also a user who relies on the kindness of strangers but learning more PHP everyday;) I'm still wondering if I couldn't just replace the quiz module 1.3 that is having errors with a ziped version of 1.3 and just replace it?
In reply to Will Muenchow

Re: Missing important code?

by Art Lader -
I do not see how replacing the quiz module could hurt anything. It is already broken on your site, right?

-- Art
In reply to Art Lader

Re: Missing important code?

by Will Muenchow -

Yeah, somewhat broken as it will not save. Had a thought though. Last week I the admin of the box moodle is hosted on made some changes to php config file for a session issue we were having with KnowledgeTree (DMS system that Moodle should use!), the change helped with KnowledgeTree but may be what is causing my current error? This is what its in the MOD.php that it bringing up the error.

require_login();

##Could it be possible that the vars are not being stored right because of this change we made in the php config file? Thus causing the error that is bolded below?

if (isset($SESSION->modform)) {   // Variables are stored in the session
        $mod = $SESSION->modform;
        unset($SESSION->modform);
    } else {
        $mod = (object)$_POST;
    }

    if (isset($cancel)) { 
        if (!empty($SESSION->returnpage)) {
            $return = $SESSION->returnpage;
            unset($SESSION->returnpage);
            redirect($return);
        } else {
            redirect("view.php?id=$mod->course");
        }
    }


    if (isset($_POST["course"])) {    // add or update form submitted

        if (!$course = get_record("course", "id", $mod->course)) {
            error("This course doesn't exist");
        }

        if (!isteacheredit($course->id)) {
            error("You can't modify this course!");
        }

        $modlib = "$CFG->dirroot/mod/$mod->modulename/lib.php";
        if (file_exists($modlib)) {
            include_once($modlib);
        } else {
            error("This module is missing important code! ($modlib)");

In reply to Will Muenchow

Re: Missing important code?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Something very weird here - sounds like you might have a broken installation. Try turning on debug in the site settings just in case it turns anything up. Also check your apache error logs just after the error happens.

I am thinking that this is a symptom of some other problem. The path in the error message doesn't look right at all.