Moodle

Settings block can be deleted and is difficult to get back again

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Blocks
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

As admin, go into a course, and delete the settings block.
You have deleted the settings block for all users on the entire system (and can do the same for Navigation).

I think these two blocks should not display delete buttons at all in the GUI when editing is on.

Can we put a check in the block drawing codefor a new method in the block that prevents the delete button showing?

Activity

Hide
Tim Hunt added a comment -

I am a bit hesitant about allowing block authors to disable delete. Perhpas a hard-coded list, or $CFG->undeletableblocktypes would be better.

Show
Tim Hunt added a comment - I am a bit hesitant about allowing block authors to disable delete. Perhpas a hard-coded list, or $CFG->undeletableblocktypes would be better.
Hide
Sam Hemelryk added a comment -

Cool thanks Tim, I was keen to see what you thought was the right way around this.
I'll have a think about where this should go and purpose a solution

Show
Sam Hemelryk added a comment - Cool thanks Tim, I was keen to see what you thought was the right way around this. I'll have a think about where this should go and purpose a solution
Hide
Martin Dougiamas added a comment -

A config setting called undeletableblocktypes that is a comma-separated list of block names would be a good idea.

Default: settings_navigation_tree, global_navigation_tree

Arg, now I wish these blocks were just called "navigation" and "settings" ...

Show
Martin Dougiamas added a comment - A config setting called undeletableblocktypes that is a comma-separated list of block names would be a good idea. Default: settings_navigation_tree, global_navigation_tree Arg, now I wish these blocks were just called "navigation" and "settings" ...
Hide
Sam Hemelryk added a comment -

Resolved, have added $CFG->undeletableblocktypes and commented in config-dist

Show
Sam Hemelryk added a comment - Resolved, have added $CFG->undeletableblocktypes and commented in config-dist

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: