trema-tech / moodle-theme_trema

Theme trema, a Moodle LMS plugin.
https://moodle.org/plugins/theme_trema
GNU General Public License v3.0
39 stars 19 forks source link

Moodle 4.1.6 Drawer Block issue #172

Closed gioconte2 closed 10 months ago

gioconte2 commented 11 months ago

Hello, I have upgraded to moodle version 4.1.6, and used the lastest version of the Trema theme. But, after going to the Dashboard as soosn as I click to open the drawer I am getting the following error: "Error updating user preference 'drawer-open-block' using ajax. Clicking this link will repeat the Ajax call that failed so you can see the error: " as warning pop up window. But, after clicking on the "Ok" button of the button pop up window, it does not apper anymore. The problem is everytime I log back into it, and go to the Dashboard and open the drawer the error message appears again. Could someone have a look at it, and try to fix the issue, becaue we really like the Trema theme and would like to keep on using it. This is the error I see when I look at the inspect console: "Failed to load resource: the server responded with a status of 404 (Not Found) /lib/ajax/setuserpref.php?sesskey=heUrxjEJuN&pref=drawer-open-block&value=true". FYI, I did I test by selecting the Boost theme insetad of Trema, and when I do the above mentioned steps I do not get the error. Thank you. Giovanni.

michael-milette commented 11 months ago

Hi @rmady ,

I have the same issue when I open the drawer on the home page the first time I open the drawer.

This can be reproduced by opening an Incognito/Private window in your web browser, navigating to the home page and opening the blocks drawer.

image

Note that this only happens the first time you open the block drawer (or after you delete the cookie I suppose). Does not seem to matter whether you are logged in or out.

Best regards,

Michael Milette

michael-milette commented 10 months ago

Note that I cannot reproduce the issue anymore using the latest main branch of Trema available here on GitHub from September 8, 2023 on Moodle 4.3. I did not test the fix with previous versions of Moodle.

Michael

ewallah commented 10 months ago

In Moodle 4.3 the error (but perhaps also the functionality) is gone due to line 34 if ($CFG->branch <= 402) {

The easiest way to check or reproduce this problem is using Behat:

php admin/tool/behat/cli/run.php --profile="chrome" --tags="@block_navigation" --suite="trema"

michael-milette commented 10 months ago

Hi @ewallah ,

Thanks for the feedback. However, that fix was only introduced a few days ago and only affects Moodle 4.3+. The original report was an issue with 4.1.

As for the functionality, I noticed a similar change in all Boost-based themes for 4.3. Those lines are usually removed but I used this IF statement to maintain compatibility with previous versions of Moodle.

In any case, I am going to close this ticket as done since nobody seems to be able to reproduce the issue anymore. Should someone be able to reproduce the issue, please add a comment and I will reopen this ticket.

Thanks again for taking the time to test, report back and the behat tip.

Best regards,

Michael