Collapsed topics settings do not show (for some users)

Collapsed topics settings do not show (for some users)

by Howard Miller -
Number of replies: 4
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

A strange one...

When I as administrator create a new course and then select Collapsed topics the page refreshes and a whole bunch of new settings appear. 

For at least two users (who are Managers) the page refreshes and only a few options show as follows...


If they then save the page and re-open the settings, the complete list is shown. 

Before I start digging, has anybody seen this or got any thoughts?

Average of ratings: -
In reply to Howard Miller

Re: Collapsed topics settings do not show (for some users)

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

Hi Howard,

Have the 'topcoll' capabilities been changed in some form?....

Collapsed Topics capabilities for a Manager

G

In reply to Gareth J Barnard

Re: Collapsed topics settings do not show (for some users)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes - all these caps are allowed for Managers and teachers. 

They only can't see them the first time they select Collapsed Topics. Having saved the initial settings screen and re-entered it the screen is correct. We also checked with the JavaScript console open and there's no errors show there. 

In reply to Gareth J Barnard

Re: Collapsed topics settings do not show (for some users)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Ok... the problem is here...

has_capability('format/topcoll:changelayout', $coursecontext)

(in lib.php around line 1194)

For some weird reason Managers are failing this test when they change the course format and the page refreshes. However, once they have saved the page they now 'pass' this test. Which is confusing. It must be something to do with them not having the capability (as Managers in a higher context) in the course context... but they should surely?

EDIT:

Ahhh.... where does the course context come from when the course does not exist yet?

EDIT EDIT:

Got it... when a course is created and the course doesn't exist yet, the courseid defaults to 1, i.e. the 'frontpage' course. These users are assigned the Manager role in subcategories not the site itself. So, at this stage they do not have the 'changelayout' capability (because they have no site rights). Only when the settings page is saved and the course is created do they acquire these rights and can see the settings. 

So... https://github.com/gjb2048/moodle-format_topcoll/issues/24

In reply to Howard Miller

Re: Collapsed topics settings do not show (for some users)

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

Thanks for the report Howard, I'll continue to look at it when I can.