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

Smart menus: boost union admin doesn't display existing menu, throws session error #666

Closed MURBASLMS closed 2 weeks ago

MURBASLMS commented 4 weeks ago

Hi, i haven't fiddled much with smart menus but am interested in rolling them out sometime. I found that when i created one for the main nav (basic settings to show a submenu list for a system staff role), it displays ok outside of theme admin eg dashboard context, but now i can't edit it or add another one - it throws a session error when i save a new one.

The nav menu doesn't display at all while in theme admin. when i go to add a new smart menu there is a message about not being able to display the draft version of the description.

line 85 of /lib/sessionlib.php: moodle_exception thrown
line 42 of /theme/boost_union/smartmenus/edit.php: call to require_sesskey()

is all i can see in debugging. have cleared caches, session, logged in again etc.

MDL 4.1.10+ (Build: 20240530) latest MOODLE_401_STABLE boost union.

whuml commented 3 weeks ago

Hi @MURBASLMS we are note sure what you mean with "outside of theme admin". Does it mean not logged in as admin or not in the admin setting or ...?

Could you pls try to describe more detailed or/and add some screenshots?

Thanks for clarification and best regards Wolfgang

MURBASLMS commented 3 weeks ago

sorry, not the first time i've been vague :)

i mean not in theme settings pages. i'm logged in as admin, i set up a smart menu, added an item, went back to dashboard, it appeared in the top nav menu as configured. Went back to add another item and in the theme smart menu page there is nothing set up. I go to add another one and it throws a session error and won't let me save anything. I go back to dashboard and the original menu is still there.

Dashboard___MyMurdoch_Learning

MURBASLMS commented 3 weeks ago

... however, NOW the smart menu is there, after another login perhaps (although i had already done that the other day, cleared sessions, cache etc) - however it is failing in a similar way, in that, i go to add another menu item, that works, i go back to the dashboard, it appears ok, go back to theme settings for smart menu and the item i just added isn't there in the list of items in the smart menu i just edited.

MyMurdoch_Learning__Administration__Appearance__Themes__Boost_Union__Smart_menus___MyMurdoch_Learning Dashboard___MyMurdoch_Learning
HsH-Wolf commented 2 weeks ago

Dear @MURBASLMS

I tried to reproduce this behaviour, but for me everything works fine. Could you please provide a detailed step by step describtion (or maybe a screencast) to reproduce this behaviuor. If it is possible, please try to reproduce it in an "empty" moodle to exclude side effects from other settings or plugins.

Best regards in behalf of the boost union team Yvonne

MURBASLMS commented 2 weeks ago

no worries, will test some more, thanks for looking.

It's just odd that it seems related to the session getting lost each time, not that sure what other plugin or setting would be conflicting.

MURBASLMS commented 2 weeks ago
Cursor_and_Developer_Tools_—_MyMurdoch_Learning__Administration__Appearance__Themes__Boost_Union__Smart_menus___MyMurdoch_Learning_—_https___lmsapppre_murdoch_edu_au_theme_boost_union_smartmenus_edit_items_php_menu_2_sesskey_YmDfDbn3g9

not sure if it helps, but i get a heap of these js errors when i go to add a smart menu item.

MURBASLMS commented 2 weeks ago

found the issue. is related to our set up. we use varnish which seems like it is caching the items.php page. It was likely caching the page content before the new menu item was added, resulting in the changes not being reflected.

lucaboesch commented 2 weeks ago

Great, thanks a lot!