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

Possible bug in render_custom_menu_item #455

Open
juaneladio opened this issue Aug 4, 2017 · 0 comments
Open

Possible bug in render_custom_menu_item #455

juaneladio opened this issue Aug 4, 2017 · 0 comments

Comments

@juaneladio
Copy link

juaneladio commented Aug 4, 2017

When I was reviewing a bug in a Moodle installation with the Theme Elegance (that uses Theme Bootstrap), I noticed that a menu item was generated incorrectly.

Long story short: The text "Hola" appears as a class atribute.

<ul class="dropdown-menu "><li><a class="Hola" title="Hola" href="/moodle/message/index.php?user1=76&amp;user2=2"><img src="/moodle/theme/image.php/elegance/core/1501546512/u/f2" alt="Picture of User" title="Picture of User" class="userpicture defaultuserpic" width="35" height="35" /><span class="msg-body"><span class="msg-title"><span class="msg-sender">Admin: </span>Hola</span><span class="msg-time"><i class="icon-time"></i><span>11 mins 42 secs</span></span></a></ul>

Now imagine that the text "Hola" changes to a larger text ...

I think the bug is created by this line of code in Theme Bootstrap:

https://github.com/bmbrands/theme_bootstrap/blob/master/renderers/core_renderer.php#L144

And class should be empty at this point, because nothing guarantees that $menunode->get_title() will always be a CSS class.

$class = '';

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant