Open pf-aleido opened 2 months ago
Hi @pf-aleido,
thanks for reporting this issue. On my totara 18 test site, I cannot reproduce the issue with the current version of Video time for totara (1.8). Can you please check if you still encounter the issue with video time 1.8?
Thanks!
@stefanscholz Hi Stefan, Can you reproduce the bug in lower versions of mod_videotime in your Totara? You must be logged in as a regular user (not site admin), and go directly to a videotime activity view page, belonging to a course you are not enrolled in.
Heres a screenshot showing debugging trace of the exception, in a totara 18.9 with mod_videotime 1.7.2
I now tried with mod_videotime branch totara18
$plugin->component = 'mod_videotime'; $plugin->release = '1.8.2'; $plugin->version = 2024050603;
Same exception with that version.
Hi @pf-aleido, I don't have multiple test sites for totara 18 available at the moment, so cannot test it with a lower version of video time unfortunately. As you know, it is not possible to downgrade plugins on totara, and I need the test site for testing purposes for the 1.8 version (I already have setup multiple test scenarios)
So just to clarify: the issue that you encounter is that if an authenticated user that is not enrolled in a course gets an error if he tries to navigate to a video time activity via direct url?
For my understanding; why is this happening? I mean, why would users actually do that? Is the link somewhere available to the learner (maybe in a different course) and you'd want the enrolment page to show? Please explain.
One more thing: are there any specific reasons why you are still using 1.7?
We are not sure about the customers intention actually. Its not a frequent problem. But some users got them from somewhere. Might be that learners share links to each other, or the customer publish direct links in external systems. However, the code should handle it and not throw an exception imo.
Theres no specific reason why we still use 1.7 except from lack of resources :). Are there any release notes for 1.8 by the way?
We use mod_videotime release 1.5.5 in a Totara v13 Same exception in mod_videotime release 1.7.2 in a Totara v18
An exception are throwned when a non-enrolled user visit the activity view page.
Reproduce: In Totara, enable audiencevisibility Create a course, add a videotime activity. Copy the url to the videotime activity view page
Log in as a non enrolled user. Go directly to the activity view page with the url copied in previous step. An exception are throwned - related to the $PAGE object.
Proposed solution: On mod_videotime/view.php, setup $PAGE more like server/mod/facetoface/view.php Set $PAGE->set_cm($cm) Before call to require_login:
$PAGE->set_url('/mod/videotime/view.php', ['id' => $cm->id]);
$PAGE->set_cm($cm);