moodle-an-hochschulen / moodle-theme_boost_union

Theme Boost Union is an enhanced child theme of Boost which is intended, on the one hand, to make Boost simply more configurable and, on the other hand, to provide helpful additional features for the daily Moodle operation of admins, teachers and students.
GNU General Public License v3.0
55 stars 49 forks source link

Flavours/Logos & Policies & Login #684

Open create-martin opened 3 days ago

create-martin commented 3 days ago

Describe the bug So, I have a quite simple setup. A couple of flavours that just change the Logo & compact Logo based on cohorts. I also have tool_policy set up, for privacy agreement.

If I login (for the FIRST TIME!!) with a user, I first get to see the policy (as expected), but the Logo is not loading:

image

The path for the logo is: DOMAIN/pluginfile.php/1/theme_boost_union/flavours_look_logocompact/11/1720080992/logo-file-name.png

After I accept the policy, I get redirected to the logo image (it will actually just load the image). I need to manually change the URL to get to the dashboard, which of course is an absolutely no-go for first-time-users.

My guess: on the policy site, the flavour is not loading correctly (maybe user is not fully logged in, hence cohort-info is not there?), and the logo-file-path gets "saved" in the background. And after the completed login, Moodle automatically forwards me to the URL it was not able to load before. (kind of like, when I enter a direct link into a course, I get redirected to login-page and after login I get forwarded to course-url, I entered before)

Upon second login, it works --> as I'm not presented with the policy, hence cohort is directly know after login and the logo can be loaded...

I think, the issue lies with the path to the flavour-logos, which probably can only be loaded, when user is logged in (which makes of course total sense from a security perspective).

Note: if I use a user, that is NOT using a flavour, it works just fine.

Not sure about possible solution, since I just don't know about the actual "login state" of a user during policy-agreement. But...would it be possible to upload the logos as Union ressources (which are available without login) and then on the flavours page select a file from the ressources?

To Reproduce Steps to reproduce the behavior:

  1. Create a new cohort
  2. Create flavour with different logo and cohort-restriction
  3. Create a site policy using tool_policy (mandatory one)
  4. Create a user, add it to the new cohort and login with this user

Expected behavior Ideally, already show correct flavour-logo on policy-page.

If that is not possible, due to Moodle restrictions, could there be a fallback to the "normal" Union Logo? (this one gets shown correctly on policy site). So there should not be a path Moodle cannot load, so after policy agreement, there is no need for Moodle to try to forward me somewhere...