Opencast-Moodle / moodle-block_opencast

Block to manage Opencast publications in moodle
21 stars 27 forks source link

Providing single video as an lti module doesn´t work #377

Open jqr86 opened 2 months ago

jqr86 commented 2 months ago

Hi there, we have following installation: Opencast 15.1 Moodle 4.1 block_opencast v4.3-r2 tool_opencast v4.3-r1

Problem: When providing a single video as an activity for students to watch directly in Moodle, I get following error in Moodle.

Bildschirmfoto 2024-04-30 um 09 29 17

We do not have opencast_mod installed.

But as a test we installed opencast_mod (v4.3-r1) and deactivated it in Moodle and the providing of the single Video worked fine.

This issue is somehow related to: https://github.com/Opencast-Moodle/moodle-block_opencast/pull/361

Greetings Raffaela

elke-hsh commented 2 months ago

Hi Rafaella,

If the defaults assignment in classes/local/ltimodulemanager.php is written into the if branch, then it will work.

 445         // Apply completion defaults.
 446         $module = $DB->get_record('modules', ['name' => 'opencast']);
 447         if ($module) {
 448             $defaults = manager::get_default_completion($course, $module);
 449             foreach ($defaults as $key => $value) {
 450                 $moduleinfo->$key = $value;
 451             }
 452         }

Please see the fork here: https://github.com/elke-hsh/moodle-block_opencast/tree/fix/defaults_on_condition

Greetings, Elke

mwuttke commented 2 months ago

@elke-hsh, please can you make a pull request for this patch?

jqr86 commented 2 months ago

@elke-hsh, many thanks for the answer. I'm sure I didn't make myself clear, but we have installed block_opencast version v4.3-r2 and the above-mentioned patch and we still get the error.

If we adjust the line 446 in classes/local/ltimodulemanager.php like this:

446 $module = $DB->get_record('modules', ['name' => 'LTI']);

so instead of 'opencast' insert 'LTI', it works.