Issue after update

Issue after update

de către Atanas Nikolov-
Număr de răspunsuri: 2

We updated CodeRunner after updating Moodle. 

Initially, everything was working fine with the old created questions, but when creating a new question, it now gives us an error "buttonDeleteFile is null", and after saving the question - "Exception - Argument 1 passed to qtype_coderunner_ui_parameters::__construct() must be of the type string, null given, called in [dirroot]/question/type/coderunner/edit_coderunner_form.php on line 972".

Moodle 3.9

CodeRunner - 4.2.3

Is there any chance of fixing it?

Thanks!

Ca răspuns la Atanas Nikolov

Re: Issue after update

de către Richard Lobb-
The message regarding buttonDeleteFile relates to the Moodle JavaScript file manager and doesn't at first glance look like it's a CodeRunner problem. I see someone else reported this error message after upgrading to Moodle 3.9: see https://tracker.moodle.org/browse/MDL-69172. The developers were unable to replicate it so the cause was never clear but it might be theme related. A similar problem, again relating to Moodle 3.9, was reported here: https://moodle.org/mod/forum/discuss.php?d=407124 Are you using the standard Moodle boost theme, or a third-party theme?

You're using a version of the CodeRunner plugin that was released in March 2022 so it has had lots of testing with Moodle 3.9. And around 280 sites are still running CodeRunner on Moodle 3.9. No one else has reported this problem. So I think there must be something different from normal about your installation.

I'm guessing that the subsequent error regarding the call to qtype_coderunner_ui_parameters__construct() is a consequence of the first. However, assuming you have access to the source code, and that you are using the Ace ui plugin, you could try the following patch.  Change line 971 in edit_coderunner_form.php from

            $uiplugin = $this->formquestion->uiplugin;
to
            $uiplugin = $this->formquestion->uiplugin ? $this->formquestion->uiplugin : 'ace';

That will at least prevent that second error from occurring, although if the first error has already resulted in corrupted form data that probably won't help much and you'll just get another error down the line. Worth a try, all the same.
Ca răspuns la Richard Lobb

Re: Issue after update

de către Atanas Nikolov-

        $uiplugin = $this->formquestion->uiplugin;
to
        $uiplugin = $this->formquestion->uiplugin ? $this->formquestion->uiplugin : 'ace';

You're a magician! Thank you, that fixed the problem!