Moodle
  1. Moodle
  2. MDL-36455

Some blocks make no sense on My Moodle pages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.4.1
    • Component/s: Blocks, My home
    • Labels:
    • Testing Instructions:
      Hide
      1. BEFORE applying this patch add all the blocks listed in the description to your My Moodle page.
      2. Apply the patch and upgrade your Moodle site.
      3. Go back to your My Moodle page and ensure the blocks are no longer present with no debugging messages about the missing capability myaddinstance.
      4. Ensure you can not re-add these blocks to this page.
      Show
      BEFORE applying this patch add all the blocks listed in the description to your My Moodle page. Apply the patch and upgrade your Moodle site. Go back to your My Moodle page and ensure the blocks are no longer present with no debugging messages about the missing capability myaddinstance. Ensure you can not re-add these blocks to this page.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-36455_master
    • Rank:
      45286

      Description

      I notice that certain blocks, such as the login block, cannot be added to My Moodle. However there are quite a few blocks available in the add a block dropdown menu which make no sense on My Moodle pages:

      • Course completion status
      • Course/site description
      • Latest news
      • Mentees
      • Online users
      • Random glossary entry
      • Self completion

      It would be good if these could be removed from the add a block dropdown menu on the My Moodle page.

        Issue Links

          Activity

          Hide
          David Mudrak added a comment -

          Hi Helen.

          Let me disagree a bit. Some of these blocks may make sense at My Moodle pages. I can imagine Latest news, Site description, Mentees or Online users pretty easily for this dashboard-like page (especially for teachers or admins - My Moodle is not just for students).

          Also note there is now a new capability "Add this block to My Moodle page" so admins can easily customize the list of "allowed" blocks at their sites.

          Show
          David Mudrak added a comment - Hi Helen. Let me disagree a bit. Some of these blocks may make sense at My Moodle pages. I can imagine Latest news, Site description, Mentees or Online users pretty easily for this dashboard-like page (especially for teachers or admins - My Moodle is not just for students). Also note there is now a new capability "Add this block to My Moodle page" so admins can easily customize the list of "allowed" blocks at their sites.
          Hide
          Helen Foster added a comment -

          Thanks David, just copying our chat comments about this issue:

          Helen: how does the latest news block work when you're not in a course?
          Helen: or self completion or random glossary entries?
          mudrd8mz@jabber.cz: Dunno. Latest news might use the Site news?
          mudrd8mz@jabber.cz: random glossary could use a global glossary?
          mudrd8mz@jabber.cz: And self-completion might display aggregated results for all courses?
          mudrd8mz@jabber.cz: I mean - maybe they do not do it now
          mudrd8mz@jabber.cz: but they could
          mudrd8mz@jabber.cz: And also I did not argue for these three
          Helen: but self-completion is for clicking a button to say you're done with a course
          mudrd8mz@jabber.cz: AH
          mudrd8mz@jabber.cz: OK, that is a bug then
          Helen: anyway, thanks for helping me see it in a new light
          mudrd8mz@jabber.cz: For my contrib block Course contents, My Moodle is not allowed destination.

          Show
          Helen Foster added a comment - Thanks David, just copying our chat comments about this issue: Helen: how does the latest news block work when you're not in a course? Helen: or self completion or random glossary entries? mudrd8mz@jabber.cz: Dunno. Latest news might use the Site news? mudrd8mz@jabber.cz: random glossary could use a global glossary? mudrd8mz@jabber.cz: And self-completion might display aggregated results for all courses? mudrd8mz@jabber.cz: I mean - maybe they do not do it now mudrd8mz@jabber.cz: but they could mudrd8mz@jabber.cz: And also I did not argue for these three Helen: but self-completion is for clicking a button to say you're done with a course mudrd8mz@jabber.cz: AH mudrd8mz@jabber.cz: OK, that is a bug then Helen: anyway, thanks for helping me see it in a new light mudrd8mz@jabber.cz: For my contrib block Course contents, My Moodle is not allowed destination.
          Hide
          Dan Poltawski added a comment -

          Lets keep this issue to which blocks work TODAY (so this issue doesn't drag on forever). Then later we can add functionality to make them work properly.

          Show
          Dan Poltawski added a comment - Lets keep this issue to which blocks work TODAY (so this issue doesn't drag on forever). Then later we can add functionality to make them work properly.
          Hide
          Mark Nelson added a comment -

          I think this was solved (if not feel free to comment). I am closing!

          Show
          Mark Nelson added a comment - I think this was solved (if not feel free to comment). I am closing!
          Hide
          Mark Nelson added a comment -

          Sorry, I thought this was related to removing the myaddinstance cap. My bad.

          Show
          Mark Nelson added a comment - Sorry, I thought this was related to removing the myaddinstance cap. My bad.
          Hide
          Mark Nelson added a comment -

          Ran through the testing instructions myself, works. It also makes a difference to the My Moodle page where users are now given a meaningful list of blocks to add.

          Show
          Mark Nelson added a comment - Ran through the testing instructions myself, works. It also makes a difference to the My Moodle page where users are now given a meaningful list of blocks to add.
          Hide
          Mark Nelson added a comment - - edited

          Notes to peer reviewer:

          1) Each block extends a block base class that contains the function:

          function applicable_formats()

          { // Default case: the block can be used in courses and site index, but not in activities return array('all' => true, 'mod' => false, 'tag' => false); }

          For the blocks that did not override this function I have just taken this template as this was their previous behaviour and added 'my' => false to it.

          2) All blocks should have four edited files - upgrade.php (to remove any blocks on the My Moodle page), access.php (to remove myaddinstance cap), block_blockname.php (to declare applicable formats) and version.php (increase version number to prompt upgrade). Please check the the information on each page is correct. I copy + pasted a lot of the code so may have not replaced a block name I should have.

          Show
          Mark Nelson added a comment - - edited Notes to peer reviewer: 1) Each block extends a block base class that contains the function: function applicable_formats() { // Default case: the block can be used in courses and site index, but not in activities return array('all' => true, 'mod' => false, 'tag' => false); } For the blocks that did not override this function I have just taken this template as this was their previous behaviour and added 'my' => false to it. 2) All blocks should have four edited files - upgrade.php (to remove any blocks on the My Moodle page), access.php (to remove myaddinstance cap), block_blockname.php (to declare applicable formats) and version.php (increase version number to prompt upgrade). Please check the the information on each page is correct. I copy + pasted a lot of the code so may have not replaced a block name I should have.
          Hide
          Adrian Greeve added a comment -

          [Y] Syntax
          [Y] Output
          [Y] Whitespace
          [-] Language
          [Y] Databases
          [Y] Testing
          [-] Security
          [*] Documentation
          [Y] Git
          [Y] Sanity check

          I had a look and everything looks good. This makes sense to me. This seems like a change that should have some documentation associated with it, but I'm not 100% sure. I'll leave that to you to investigate.

          You might want to change the pull branch for master to MDL-36455_master.

          Thanks.

          Show
          Adrian Greeve added a comment - [Y] Syntax [Y] Output [Y] Whitespace [-] Language [Y] Databases [Y] Testing [-] Security [*] Documentation [Y] Git [Y] Sanity check I had a look and everything looks good. This makes sense to me. This seems like a change that should have some documentation associated with it, but I'm not 100% sure. I'll leave that to you to investigate. You might want to change the pull branch for master to MDL-36455 _master. Thanks.
          Hide
          Mark Nelson added a comment -

          Thanks Adrian.

          Show
          Mark Nelson added a comment - Thanks Adrian.
          Hide
          Sam Hemelryk added a comment -

          Hi Mark,

          I believe this really is a master only change.
          Presently we're in the sync period after a release where master and MOODLE_24_STABLE must stay the same.
          I've added the integration_held label, this issue will be delayed until we are out of the sync period when it will be fine to land.
          If you feel I've got it wrong and that this issue is suitable to land to 24 as well then please remove the integration_held label and this will find its way back onto our queue.

          Many thanks
          Sam

          Show
          Sam Hemelryk added a comment - Hi Mark, I believe this really is a master only change. Presently we're in the sync period after a release where master and MOODLE_24_STABLE must stay the same. I've added the integration_held label, this issue will be delayed until we are out of the sync period when it will be fine to land. If you feel I've got it wrong and that this issue is suitable to land to 24 as well then please remove the integration_held label and this will find its way back onto our queue. Many thanks Sam
          Hide
          Mark Nelson added a comment -

          Hi Sam, I have to disagree with you on this. I know we are against putting improvements into current STABLE branches but in this case 2.4 has not been out for long. This change should really be included with the commit MDL-34270 and MDL-36755 as they compliment each other. I think it is best to get all these block issues done in the one stable release. Also, they are improvements but they do not affect the large majority of users. It simply stops people from adding nonsensical blocks to the MY Moodle page. There is no UI change here. So, to most people this code update will do nothing. It simply tidies up the select box on the My Moodle page when choosing a block.

          Show
          Mark Nelson added a comment - Hi Sam, I have to disagree with you on this. I know we are against putting improvements into current STABLE branches but in this case 2.4 has not been out for long. This change should really be included with the commit MDL-34270 and MDL-36755 as they compliment each other. I think it is best to get all these block issues done in the one stable release. Also, they are improvements but they do not affect the large majority of users. It simply stops people from adding nonsensical blocks to the MY Moodle page. There is no UI change here. So, to most people this code update will do nothing. It simply tidies up the select box on the My Moodle page when choosing a block.
          Hide
          Sam Hemelryk added a comment - - edited

          Hi Mark,

          Unfortunately we work in a democracy, and once discussed with the other integrators and put to the vote it was decided that this is suitable to land to 2.4 as well.
          Hehe damn integrators.

          Starting a review now.

          Show
          Sam Hemelryk added a comment - - edited Hi Mark, Unfortunately we work in a democracy, and once discussed with the other integrators and put to the vote it was decided that this is suitable to land to 2.4 as well. Hehe damn integrators. Starting a review now.
          Hide
          Sam Hemelryk added a comment -

          Hey dude can you please rebase this.
          There are several conflicts presently.

          Show
          Sam Hemelryk added a comment - Hey dude can you please rebase this. There are several conflicts presently.
          Hide
          Mark Nelson added a comment -

          Your wish is my command.

          Show
          Mark Nelson added a comment - Your wish is my command.
          Hide
          Mark Nelson added a comment -

          Hi Sam, all done.

          Show
          Mark Nelson added a comment - Hi Sam, all done.
          Hide
          Sam Hemelryk added a comment -

          Thanks Mark, this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Mark, this has been integrated now
          Hide
          Sam Hemelryk added a comment -

          Tested during integration review

          Show
          Sam Hemelryk added a comment - Tested during integration review
          Hide
          Sam Hemelryk added a comment -

          Passed

          Show
          Sam Hemelryk added a comment - Passed
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Did you know that your awesome changes are the last ones landing to CVS?

          After 11 years, 2 months and 8 days... it's ended, died, closed, kaputt. Big thanks to it, has served us really well.

          Closing this as fixed, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Did you know that your awesome changes are the last ones landing to CVS? After 11 years, 2 months and 8 days... it's ended, died, closed, kaputt. Big thanks to it, has served us really well. Closing this as fixed, many thanks!
          Hide
          Wendell Jones added a comment -

          This change caught me off-guard! Is there any way that I can add the Online users block back to my My Moodle page? As the administrator of Moodle, I use the Online users block to get a quick idea of the current level of use and, as in the case of this upgrade, to tell if I can put the site into maintenance mode. I agree that many of the blocks removed by this change have no use on the My Moodle (My Home) page, but I would argue that Online users is not one of those. Thanks for your consideration.

          Show
          Wendell Jones added a comment - This change caught me off-guard! Is there any way that I can add the Online users block back to my My Moodle page? As the administrator of Moodle, I use the Online users block to get a quick idea of the current level of use and, as in the case of this upgrade, to tell if I can put the site into maintenance mode. I agree that many of the blocks removed by this change have no use on the My Moodle (My Home) page, but I would argue that Online users is not one of those. Thanks for your consideration.
          Hide
          Helen Foster added a comment -

          Wendell, thanks for your comments. From chatting to Mark and Dan about it, we realise it was a mistake to have removed the option to add the online users block to My home (My Moodle). I have created MDL-37414 for adding it back.

          Show
          Helen Foster added a comment - Wendell, thanks for your comments. From chatting to Mark and Dan about it, we realise it was a mistake to have removed the option to add the online users block to My home (My Moodle). I have created MDL-37414 for adding it back.
          Hide
          Wendell Jones added a comment -

          Great! Helen (and everyone), thanks for responding so quickly. I'll follow the new tracker item now.

          Show
          Wendell Jones added a comment - Great! Helen (and everyone), thanks for responding so quickly. I'll follow the new tracker item now.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: