Despite removing the "Section links" from the theme_boost | unaddableblocks, I cannot add it to a course IF I'm using a non-core course format such as Collapsed Topics (topcoll) or Collapsible Topics (collapsibletopics).
If I follow a workaround and first add the "Section links" block under a core course format such as Topics, and then switch to a non-core course format, I receive this debugging notice:
"Notice: Undefined variable: linktext in .../blocks/section_links/renderer.php on line 76"
(The notice is hidden under the top nav bar, so the nav bar must be hidden using browser dev tools.)
and
the "Section links" block does NOT display the "Jump to current topic" link.
As per an earlier exchange and the information received from gb2048 in https://tracker.moodle.org/browse/CONTRIB-9073 , the problem appears related to 'user_can_addto()' in '/blocks/moodleblock.class.php' and the respective call to 'applicable_formats()'. The check is only performed when the block is added not when the course format is changed.
There is, as stated first, also the problem of the "Section links" block not even being listed when trying to "Add a block" in a course using a non-core course format, so perhaps there are other responsible locations in the Moodle code yet.
Assuming the admin has removed the "Section links" from unaddable courses in a theme, the expected behaviour would be to
1) be able to add the "Section links" block also when the course is using a non-core course format - i.e. to see the block on the list available block that can be added and to be able to click on it and add it to the course as normal;
2) After adding the block to the course - to also see the "Jump to current topic" link (IF there is a highlighted / current topic in a course), and for the link to work well
3) After adding the block to the course - to receive no debugging notices (when Debugger turned and in Developer mode).
- is documented by
-
MDL-73347 Let themes define un-addable blocks
-
- Closed
-