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

blocks_have_content returns true for blocks that are not visible

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.9
    • Fix Version/s: None
    • Component/s: Blocks
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      The function blocks_have_content checks if blocks on the left or the right contains any content. It is supposed to return false if there are no blocks, or if the blocks won't output anything.

      In fact it returns true if there is a block which would output something, but which is set to visible=false in the site level block settings.

      Visible is checked at the block instance level (the eye icon on the course page) but not at the site level (the eye icon on the admin/modules/blocks/manage blocks page).

      To reproduce:

      1. Use suitable course
      2. Move all blocks from right-hand column to left-hand column, except one, e.g. Recent Activity
      3. Go to the admin manage blocks pages and click the eye icon next to Recent Activity to hide it
      4. Back on the course page, turn editing off. Observe that the block has disappeared, but there is still space reserved for the right column even though it is now empty

      You can also note that if you instead use the eye icon on the individual block itself, the 'empty' column disappears correctly.

        Gliffy Diagrams

          Activity

          Hide
          quen Sam Marshall added a comment -

          This bug does not affect Moodle 2.0.

          Show
          quen Sam Marshall added a comment - This bug does not affect Moodle 2.0.
          Hide
          quen Sam Marshall added a comment -

          Fix done and tested on current MOODLE_19, committed and marked MOODLE_19_MERGED. No change to Moodle HEAD as noted.

          Show
          quen Sam Marshall added a comment - Fix done and tested on current MOODLE_19, committed and marked MOODLE_19_MERGED. No change to Moodle HEAD as noted.

            People

            • Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Tester:
              Nobody
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: