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

Boost Union - Smart Menus - "Restrict visibility by language" is not applied correctly sometimes #697

Open
acquaalta opened this issue Jul 27, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@acquaalta
Copy link

Hi,

Moodle version: 4.3.5
Plugin version: v4.3-r13 (2023102038)

We have a couple of smart menus that their visibility is restricted by language. Since the UI is in one specific language at any given time, only one of these smart menus should be displayed.
The issue is that sometimes, and I don't understand why and when exactly, we get to see two smart menus at the same time. It's is unwanted, of course, and a duplication of a menu since the content in both menus is the same.

Did you encounter such an issue?

@acquaalta acquaalta added the new issue to be labeled by Boost Union Team label Jul 27, 2024
@anna-sparkfore
Copy link

anna-sparkfore commented Aug 7, 2024

We have also this problem and we run Moodle ver 4.3.2 and plugin ver v4.3-r13.
I have tested with the language restriction on the top level and sometimes got the menu item in several languages. I have not been able to identify why this happens either, unfortunately. It's not happening in the same session though. I have seen the error when I logged in anew maybe 1 h later.

@acquaalta
Copy link
Author

Hi @anna-sparkfore
It's "good" to know that we didn't "imagine" this bug. I hope that it will be solved at some point. Thanks for your comment :-)

@wiebkemueller-hsh
Copy link
Collaborator

wiebkemueller-hsh commented Aug 22, 2024

Hi @acquaalta and @anna-sparkfore

could you provide some more information on this? We've had this same mistake in previous Moodle and theme versions (now on Moodle 4.4.2, Boost Union v4.4-r1) but as you said were never able to reproduce it reliably. For now I remember the following details on the problem, could you provide steps to reproduce or check if this fits with your settings so we can hopefully nail this down to a particular combination?

Menu mode: inline
Presentation type: list
Menu item type: static

  1. Login as admin

  2. create new smart menu under /theme/boost_union/smartmenus/menus.php with the following setting
    Menu mode: inline
    Presentation type: list
    restrict visibility by language (e.g. German)
    Menu item type: static (in our case we linked to a particular course in the system
    restrict visibility by language (e.g. German) for menu item

  3. duplicate the whole thing

  4. change restrict visibility by language (to English) in the duplicate for the menu and for the item

What happened was that the original menu would appear twice for mainly admins and users logged in as managers, probably after having changed the systems language a few times to test, varying with browsers.

Does this procedure ring a bell with you? Please add more or altering steps if possible, thank you!

@Imiladris
Copy link

This happens, after visiting courses with forced language.
i.e. My prefered system language is russian, I see Russian language. If i visit a course with forced English, both RU and En menues display

@acquaalta
Copy link
Author

Hi @wiebkemueller-hsh,
We experience the bug with different settings:
Menu mode: Submenu
Presentation type: List
Menu location: Main Navigation
Menu item type: Dynamic courses
Access rules: By language

@anna-sparkfore
Copy link

Here's a fresh example:
I log in and the interface is in Swedish but there are 2 menu items showing:
image

I visit the Preferred language page to verify that my selected language is Swedish:
image

In Smart menues I have 2 items: Admin shortcuts in Swedish and English.
Menu location(s): Main navigation
Menu mode: Submenu
Presentation type: List
Restrict visibility by roles: Manager
Restrict visibility by language: Swedish - English (one per each)
image

The menu items are static and have no additional restrictions:
image

I then used the Language selector to switch language to English (which is a temporary language switch). Then the interface reloads and only the Smart menu in English is shown, now the Swedish menu is hidden.
image
image

I then logged out, and logged in again. Now only the Smart menu in Swedish appears.
image

Is there an issue with having 2 restrictions (user role = manager + language = English/Swedish) on a Smart menu? How would you recommend the setup for that scenario?

@anna-sparkfore
Copy link

Also, I just realized a detail that might be related. We use a child language pack "sv_wp" instead of sv AND we have a customized language menu to avoid having 2 Swedish options in the language selector:
image

@wiebkemueller-hsh wiebkemueller-hsh added the bug Something isn't working label Oct 2, 2024
@wiebkemueller-hsh
Copy link
Collaborator

Thank you for the detailed examples and documentation on this, we will try to figure something out.

@Marvin-Kirch
Copy link

Hello everyone,
We have encountered exactly the same problem. We have noticed that the problem always occurs when you log out and are only logged in as a guest. If you visit the course page and change the language, both smart menus are displayed.
If you then log in again as admin, you have the same problem. Otherwise the problem seems to occur almost randomly.

we tested the plugin versions v4.3-r13 (2023102038) and v4.3-r15 (2023102042)

@HsH-Wolf HsH-Wolf removed the new issue to be labeled by Boost Union Team label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready for DEV
Development

No branches or pull requests

6 participants