Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-45604

instance_can_be_hidden() not obeyed by block config

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7, 3.10.5, 3.11.1
    • FRONTEND
    • Blocks
    • MOODLE_27_STABLE, MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-45604-master
    • Hide
      1. In a course, create an HTML block.
      2. Configure the block, add a title and content, set visible on this page to no.
      3. Save and confirm the block is hidden.
      4. In blocks/html/block_html.php add this within the class

            public function instance_can_be_hidden() {
                return false;
            }

      5. In the course, with editing on, see that there isn't a show/hide option in the block setting menu.
      6. Go to configure the block, under on this page, visible should be hard set to Yes.
      7. Save and confirm the block is now visible.
      Show
      In a course, create an HTML block. Configure the block, add a title and content, set visible on this page to no. Save and confirm the block is hidden. In blocks/html/block_html.php add this within the class public function instance_can_be_hidden() { return false; } In the course, with editing on, see that there isn't a show/hide option in the block setting menu. Go to configure the block, under on this page, visible should be hard set to Yes. Save and confirm the block is now visible.

    Description

      If you set instance_can_be_hidden() to false for a block, the 'hide block' option is gone from the menu, but the user can still go into the 'configure this block' settings and set visible to No.

      Attachments

        Issue Links

          Activity

            People

              emerrill Eric Merrill
              emerrill Eric Merrill
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: