Error from questionlib.php

Error from questionlib.php

by Ahmad Hammado -
Number of replies: 1

On line 1539 of questionlib.php (version # 2011120500.01)

            if (has_capability($cap, $context)) {

Throws:

Debug info: Argument 2 passed to has_capability() must be an instance of context, boolean given, called in ...\lib\questionlib.php

 

So I modified the question_edit_contexts constructor to check if instance_by_id returns false:

        foreach ($pcontextids as $pcontextid) {
            if ($context = get_context_instance_by_id($pcontextid))
            {
                $contexts[] = $context;
            }
        }

Not sure why it happens to this particular course. This is an instance updated from 1.9.

 

Thanks,

Average of ratings: -