Moodle 3.1 shows section name twice

Moodle 3.1 shows section name twice

by Aylwin Cal -
Number of replies: 20

I've just upgraded to Moodle 3.1+ and I've noticed something strange.  With the normal topics format, the section names are now displayed twice:

section_names

Is this normal?  Or a bug?  Or something wrong or misconfigured in my setup?

By the way, I upgraded from 2.9+ and I believe I've never seen anything like this since 1.9.

Average of ratings: -
In reply to Aylwin Cal

Re: Moodle 3.1 shows section name twice

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Can you tell us what theme you are using please - the boxes around each separate topic don't look like clean or more.

Could you test in Clean and report what happens there.

Clean topics

In reply to Richard Oelmann

Re: Moodle 3.1 shows section name twice

by Aylwin Cal -

Aha!  It's the theme!  I'm using a heavily customized theme based on the old standard theme.  Looks like I'll have to update my theme to be now based on clean or more.  This won't be enjoyable. sad

But thanks very much for the help!

In reply to Aylwin Cal

Re: Moodle 3.1 shows section name twice

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Peer reviewers Picture of Plugin developers Picture of Testers

There were changes in the 3.1 to make section names in-place editable (similar to activity names). The renderers for the course formats (including topics) were changed too (commit), it might have caused conflicts if your theme overrode format_topics_renderer.


In reply to Marina Glancy

Re: Moodle 3.1 shows section name twice

by François Lizotte -
Picture of Particularly helpful Moodlers

Same here. We are still carrying some old theme for some of our institutions. I guess it's time to move on.



In reply to Marina Glancy

Re: Moodle 3.1 shows section name twice

by Mary Evans -

Marina, this is nothing to do with theme renderers, as Base theme has none. its the fact that Base theme was not tested and therefore has regressed, and as a result will make all themes, which are children of Base theme, inherit it. Hence the problem reported here with the older themes.

 

 

 

Since I agreed to maintain Base and Canvas, I need to crack on with finding a fix for this before it gets out of hand, as this regression is evident in Moodle 3.2.

Mary

In reply to Mary Evans

Re: Moodle 3.1 shows section name twice

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mary,

Absolutely not down to the theme renderers but this line of code:

        // Create a span that contains the section title to be used to create the keyboard section move menu.
        $o .= html_writer::tag('span', get_section_name($course, $section), array('class' => 'hidden sectionname'));

in /course/format/renderer.php::section_header() whereby 'base' does not implement the 'hidden' selector to hide the first instance of the section name.

In reply to Gareth J Barnard

Re: Moodle 3.1 shows section name twice

by Mary Evans -

Thanks Gareth for looking into this, I opened a tracker issue to fix theme_base.

I have also been looking at the original commit for that line. Unfortunatally I cant do anything about it as I am too busy with home and family.

However I have concluded that the changes that went on with the section edit, have not really helped that much with the display of the page generally.

Tired and fed up

Mary

 

In reply to Gareth J Barnard

Re: Moodle 3.1 shows section name twice

by Mary Evans -

Here is the tracker MDL-57405

In reply to Mary Evans

Re: Moodle 3.1 shows section name twice

by Greg L -

I'm a little late to the party. We just upgraded to 3.1.2 and using the Magazine theme. Does anyone have a fix for this theme? Is this a CSS or PHP fix? 

Thanks!!

- Greg

Attachment Screenshot (2).png
In reply to Greg L

Re: Moodle 3.1 shows section name twice

by Mary Evans -

Hi,

Try adding the following CSS to the CSS Custom area found in the Magazine theme settings page ...

Administration > Site Administration > Appearance > Themes > Magazine

#page-course-view-topics span.hidden,
#page-course-view-weeks span.hidden  { display: none; }

Should fix it.

Cheers

Mary

In reply to Mary Evans

Re: Moodle 3.1 shows section name twice

by Greg L -

Thanks for the quick reply. The Magazine theme doesn't have a Custom CSS field box. I tried to put it in the More (Administration > Site Administration > Appearance > Themes > More) setting page but that didn't work. 

Is there another location I should try on our Moodle site? Or should I try to put it somewhere in the themes CSS folders?  If so, which folder would you recommend?

Thanks!

- Greg

Attachment Screenshot (3).png
In reply to Greg L

Re: Moodle 3.1 shows section name twice

by Mary Evans -

Hi, the More theme is nothing to do with the Magazine theme, as the parent theme is Base theme.

Your best bet would be to try adding it to the css3.css file in the magazine/styledirectory.

Hope that helps?

Mary

 

 

In reply to Mary Evans

Re: Moodle 3.1 shows section name twice

by Greg L -

That worked!

Thanks for your help!


In reply to Greg L

Re: Moodle 3.1 shows section name twice

by Mary Evans -

Great! Thanks for letting me know.

With a bit of luck I will fix the Base theme then it should fix all the other themes at the same time.

Cheers

Mary

In reply to Aylwin Cal

Re: Moodle 3.1 shows section name twice

by Brian Pool -

I would be interested if anyone knows where to fix this in the theme file.  The idea of dropping all existing themes organizations use is silly since there is obviously a way to fix this in the code.  We are using Anomaly and Campus, both of which do the same thing.  Any help would be appreciated.

Brian

In reply to Brian Pool

Re: Moodle 3.1 shows section name twice

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Not happening in the Campus theme as I don't override any course format renderers.  Screen shots attached as evidence for both values of course layout.  Please provide evidence.

Attachment 2016-08-10 22_04_15-Start.png
Attachment 2016-08-10 22_05_23-Start.png
In reply to Gareth J Barnard

Re: Moodle 3.1 shows section name twice

by Brian Pool -

I apologize and stand corrected.  Campus is in fact working fine.  The course I referenced had not unchecked the header box and looked wrong, but it was a user error on the course.  We use Campus for our K-4 theme and Anomoly for our 5-12 Theme, so I would love to fix it.

That being said.  What do you mean " I don't override any course format renderers."  Sounds like I might be able to comment that out of the "bad" theme to fix my issue.

Appreciate your help!

Brian

In reply to Brian Pool

Re: Moodle 3.1 shows section name twice

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
In reply to Gareth J Barnard

Re: Moodle 3.1 shows section name twice

by Brian Pool -

Thanks for the link, but it turns out it doesn't look like that is the issue.  When I commented out the renderer line, it changed a couple of items, but not the duplicate names on the course page.  I am sure it is simply a line of code I will be able to comment out, once I find it!

//$THEME->rendererfactory = 'theme_overridden_renderer_factory';

Thanks again for the input!


Brian


In reply to Brian Pool

Re: Moodle 3.1 shows section name twice

by Brian Pool -

I was recently contacted about the fix to this. from the Theme developer.

Simply go into the custom CSS section and drop the following code in!

The directions to the settings page are as follows:
Administration > Site Administration > Appearance > Themes > Anomaly

#page-course-view-topics span.hidden,
#page-course-view-weeks span.hidden  { display: none; }


I actually assume this will most likely fix ANY theme that has the issue.  I will be testing others!

Brian