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

instance_can_be_hidden() not obeyed by block config

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 2.7, 3.10.5, 3.11.1
    • 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.

      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.

            emerrill Eric Merrill
            emerrill Eric Merrill
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.