Moodle Messing Up Layout with Scattered Tags

Moodle Messing Up Layout with Scattered Tags

by Keary Suska -
Number of replies: 6

For some reason our non-logged in home page layout started appearing messed up and I was able to track the issue to Moodle (v3.8+) wrapping certain block level elements in <b> tags, which is interfering with the proper display. I am not sure how these tags are gettin gin there as the theme templates do not include them. I have purged all coaches but no luck. Site: https://7cedarstraining.com/courses/

Average of ratings: -
In reply to Keary Suska

Re: Moodle Messing Up Layout with Scattered Tags

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
No idea how that is happening. I see that you're using a custom theme 'newcedar' therefore, switch to Boost and see if its still there, if not then examine the theme code, if so then need to look at all the code and the settings, i.e. look in all the templates for the 'b' tag, the html_writer for 'b' and the PHP code for 'b' tags and any JS too.
In reply to Gareth J Barnard

Re: Moodle Messing Up Layout with Scattered Tags

by Keary Suska -

More precisely, it wraps the other columns (i.e. content other than main page) and footer DIVs in B tags, and there are some scattered empty B tags. These only appear under certain circumstances, such as when not logged in and for a certain admin user. After clearing my browser cache, now, for the account that doesn't experience the problem, the admin menu is moved to a different location, but only on the "course" pages, such as the "home" course listing, course descriptions, etc. But not the admin pages, or "site" pages. Note that for the account that the problems occurs, these pages also display fine, but with the misplaced admin nav menu. Only the "home" page displays incorrectly for this account. So there may be a connection between how these pages are rendered for different users.

Playing around, I see that the difference between the pages is that the admin menu is over in all three-column layouts, but in the correct place for two-column layouts.

Perhaps the key clue is, why is the difference showing for different users (same browser, same machine, just different login)? Are there user-specific settings that can affect menu/navigation display?

In any case, I searched the theme for any occurrence of a singular letter "b" (case insensitively) and only found css selectors. I also searched the Boost theme upon which the custom theme is based but the JS is minified so pretty inscrutable.

In reply to Keary Suska

Re: Moodle Messing Up Layout with Scattered Tags

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Look in the database user and config_plugins areas for any iffy data that could be messing up the site, like a copy / paste from Word, which has been known to break things.  Does the issue happen when you use Boost instead.
In reply to Gareth J Barnard

Re: Moodle Messing Up Layout with Scattered Tags

by Keary Suska -

There doesn't seem to be anything unusual in config_plugins. By user do you mean looking at the specific user that is experiencing the layout issue? If so then there wasn't anything unusual there either. 

I did change the theme to Boost and it does render the <b> tags in other places, though Boost does not have an analog to our custom theme so I can't tell about what is causing our problem. It is putting <b> tags in illegal places, although it doesn't seem to bother the Boost theme any. In our case, it screws up the nav. Those tags should not be rendered there at all. Is there any way to know (without combing through every commit comment) whether an update has changed this behavior?

Since this issue just appeared this week, I suspect that this was always the case and the browsers we use just decided to be stricter about it. As far as I can tell nothing else has changed. Why the admin nav is has changed location is beyond me.

In reply to Keary Suska

Re: Moodle Messing Up Layout with Scattered Tags

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
By 'user' I do mean the user tables in the database. If its happened in the last week then you are going to have to examine what has changed since then, i.e. any files / plugins updated / added etc. and I disagree with 'I suspect that this was always the case and the browsers we use just decided to be stricter about it', this is an 'output' issue as the tag should not be there in the first place.