Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kaltura resource error in "Default activity completion" #426

Open
jaume77 opened this issue Apr 25, 2024 · 4 comments
Open

Kaltura resource error in "Default activity completion" #426

jaume77 opened this issue Apr 25, 2024 · 4 comments

Comments

@jaume77
Copy link

jaume77 commented Apr 25, 2024

Hello,

Moodle version: 4.3.2
Kaltura plugin version: 2023100901

After installing the Kaltura plugin package, when accessing the "Default activity completion" page, the following error is displayed:

"Coding error detected, it must be fixed by a programmer: Cannot call moodle_page::add_body_class after output has been started."

image

Coding error detected, it must be fixed by a programmer: Cannot call moodle_page::add_body_class after output has been started.

[More information about this error](http://docs.moodle.org/403/en/error/debug/codingerror)

Debug info:
Error code: codingerror×Dismiss this notification
Stack trace:
line 1357 of /lib/pagelib.php: coding_exception thrown
line 42 of /mod/kalvidres/mod_form.php: call to moodle_page->add_body_class()
line 217 of /lib/formslib.php: call to mod_kalvidres_mod_form->definition()
line 127 of /course/moodleform_mod.php: call to moodleform->__construct()
line 96 of /completion/classes/defaultedit_form.php: call to moodleform_mod->__construct()
line 120 of /completion/classes/defaultedit_form.php: call to core_completion_defaultedit_form->get_module_form()
line 217 of /lib/formslib.php: call to core_completion_defaultedit_form->definition()
line 45 of /completion/classes/defaultedit_form.php: call to moodleform->__construct()
line 86 of /course/classes/output/bulk_activity_completion_renderer.php: call to core_completion_defaultedit_form->__construct()
line 97 of /course/defaultcompletion.php: call to core_course_bulk_activity_completion_renderer->defaultcompletion()

If the "Kaltura resource" activity is disabled, the page loads correctly.

The path to the page is "Site Administration" -> "Courses" -> "Default settings" -> "Default activity completion"

Greetings and thanks
Jaume R.

@simmonsgc
Copy link

Is this the same issue as #396 perhaps?

@jaume77
Copy link
Author

jaume77 commented Apr 25, 2024

This error should have appeared in a previous version of the plugin, an attempt was made to solve it (the code of the version that I indicate, which is the latest available on moodle.org, is different), but in version 4.3 of Moodle, on the configuration page What I indicated, it still doesn't work.

In line 41 and 42 of the file mod_form.php, the code is :

...
$pageclass = 'kaltura-kalvidres-body';
$PAGE->add_body_class($pageclass);
...

@jaume77
Copy link
Author

jaume77 commented Jun 4, 2024

Hi,
It seems that by commenting line 42 of the file mod_form.php the error disappears.

...
$pageclass = 'kaltura-kalvidres-body';
//$PAGE->add_body_class($pageclass);
...

image

I don't know if there will be any "side" effects.
Greetings

@jaume77
Copy link
Author

jaume77 commented Jun 4, 2024

Speaking of "side effects"...

When applying the change, and commenting on the line, the "Default activity completion" screen is displayed correctly, and the activity creation form can be accessed correctly... except for the "Restrict access" section.

image

I have added an "if" in the code, to execute the line if it is in a course.

If id is 1 (we are in the environment administration) the line is not executed. If it is different than 1 (we are in a course), we execute it.

...
$pageclass = 'kaltura-kalvidres-body';
if($COURSE->id <> 1) {
     $PAGE->add_body_class($pageclass);
}
...

Waiting for a better solution.... :-)

Thanks!
Jaume R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants