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

Exception thrown in Totara - Videotime view.php #77

Open
pf-aleido opened this issue Sep 24, 2024 · 7 comments
Open

Exception thrown in Totara - Videotime view.php #77

pf-aleido opened this issue Sep 24, 2024 · 7 comments

Comments

@pf-aleido
Copy link

pf-aleido commented Sep 24, 2024

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.
image (4)

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);

@stefanscholz
Copy link
Member

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!

@pf-aleido
Copy link
Author

pf-aleido commented Sep 24, 2024

@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
videotimeview

@pf-aleido
Copy link
Author

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.

@stefanscholz
Copy link
Member

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.

@stefanscholz
Copy link
Member

stefanscholz commented Sep 24, 2024

One more thing: are there any specific reasons why you are still using 1.7?

@pf-aleido
Copy link
Author

pf-aleido commented Sep 24, 2024

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.

@pf-aleido
Copy link
Author

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?

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