Add a block cleanup for Moodle 4.0

Add a block cleanup for Moodle 4.0

by Helen Foster -
Number of replies: 6
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi everyone,

You've most likely noticed when adding a block to a course that the list of blocks is really long! Thus, we're looking into ways of shortening it and only displaying useful blocks.

For example, we should only list the blocks Blog menu, Blog tags and Recent blog entries if Blogs are enabled in advanced features.

For details of this project, please see the dev docs page Add a block cleanup. As always, your feedback is welcome!

Average of ratings: Useful (5)
In reply to Helen Foster

Re: Add a block cleanup for Moodle 4.0

by Luiggi Sansonetti -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi

 It's indeed a good thing that the blocks associated with deactivated options are no longer proposed in the list

And the admin presets will be another great addition to these global presets to improve the understanding of Moodle 💪

Until now I go through the block management to disable blocks that are not used in the context of usage, these improvements will make my life easier too.
In reply to Helen Foster

Re: Add a block cleanup for Moodle 4.0

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The block system already has a way to say "Is this block applicable to this page" - and then the 'Add' menu only includes the block if it can appear on this page. (Method user_can_addto in the block class.)

If, this is not taking into account whether the related feature is enabled, then I think that is just a bug, and fixing it is uncontentious. Good idea.

user_can_addto is currently implemented based on another method: applicable_formats. If it was me, I would add another method which subclasses can override, perhaps can_block_work_on_page($page) for these extra checks that should exist.
Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Add a block cleanup for Moodle 4.0

by Sara Arjona Téllez -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Tim!
Thanks a lot for your comments about one of the scenarios that we're reviewing for reducing the list of blocks displayed to users in the "Add a block" list smile
I'm glad you like the idea wink
I've started working on MDL-73339 with a similar approach to what you suggested (hopefully I will finish tomorrow the patch). However, for now, I will leave it classified as an improvement because it has been always implemented that way and, as I'm adding a new method to the API, it's recommended to avoid backporting it to stables.
Feel free to comment on the issue (or help with the peer-review if you can/want).
Cheers!
Average of ratings: Useful (2)
In reply to Helen Foster

Re: Add a block cleanup for Moodle 4.0

by Sander Bangma -
Hi all,

As part of the block cleanup we're considering disabling the following blocks by default for new installs (MDL-73342):
  • Course summary
  • Remote RSS feed
  • Feedback
  • Self completion

Keen to hear feedback from people whether this change is supported smile


Average of ratings: Useful (5)
In reply to Sander Bangma

Re: Add a block cleanup for Moodle 4.0

by Sander Bangma -
Hi all,

Please let us know your thoughts smile
At this stage we haven't received any feedback and will likely go ahead as planned unless we hear to the contrary.

Thank you all!