Moodle
  1. Moodle
  2. MDL-42122

Install is shown despite user not having moodle/community:download

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.2
    • Fix Version/s: 2.5.3
    • Component/s: Hub
    • Labels:
    • Testing Instructions:
      Hide

      1) Add a 'Community finder' block to a course.
      2) Switch role to a Non-editing teacher (by default they have moodle/community:add but not moodle/community:download)
      3) Click search in the block
      4) In the search form, type "test" as the search term and click search
      5) When the results load up, the possible buttons on each should be "Save a link to this site" and "visit institution". NOT "Install".

      Testing when you have download cap:
      6) Switch role to Teacher (which has both caps).
      7) Search again, the results this time should have buttons "Install" and "visit demo"

      Show
      1) Add a 'Community finder' block to a course. 2) Switch role to a Non-editing teacher (by default they have moodle/community:add but not moodle/community:download) 3) Click search in the block 4) In the search form, type "test" as the search term and click search 5) When the results load up, the possible buttons on each should be "Save a link to this site" and "visit institution". NOT "Install". Testing when you have download cap: 6) Switch role to Teacher (which has both caps). 7) Search again, the results this time should have buttons "Install" and "visit demo"
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull 2.5 Branch:
    • Pull Master Branch:
    • Rank:
      53319

      Description

      The moodle/community:download capability defines if a user is able to download courses from the community hub.

      However, when a user doesn't have this, they're still presented the 'install' button and search assumes they're looking for courses to download rather than ones to enrol in.

      Clicking install simply refreshes on the search screen because you don't have the capability which is good, but confusing for the user.

      Also included in the proposed fix is a $mform->setType call the formslib complains about.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that and sharing a fix.

          Hopefully it will be reviewed soon.

          Show
          Michael de Raadt added a comment - Thanks for reporting that and sharing a fix. Hopefully it will be reviewed soon.
          Hide
          Jérôme Mouneyrac added a comment -

          All good to me sending to integration

          Show
          Jérôme Mouneyrac added a comment - All good to me sending to integration
          Hide
          Dan Poltawski added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Damyon Wiese added a comment -

          Thanks Adam,

          Is there any reason this doesn't this have a 2.4 branch? Seems to me like it would affect 2.4 as well.

          Show
          Damyon Wiese added a comment - Thanks Adam, Is there any reason this doesn't this have a 2.4 branch? Seems to me like it would affect 2.4 as well.
          Hide
          Adam Olley added a comment -

          Hi Damyon, I believe it was caused by the changes to the defaults the form uses introduced in 2.5 in MDL-37012 (as per link).

          Show
          Adam Olley added a comment - Hi Damyon, I believe it was caused by the changes to the defaults the form uses introduced in 2.5 in MDL-37012 (as per link).
          Hide
          Damyon Wiese added a comment -

          Thanks Adam, makes sense. Integrated to master and 25 only.

          Show
          Damyon Wiese added a comment - Thanks Adam, makes sense. Integrated to master and 25 only.
          Hide
          Frédéric Massart added a comment -

          Passing, thanks.

          Show
          Frédéric Massart added a comment - Passing, thanks.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Yes, it's happening (somewhere in the French Polynesia, right now). And you did it, raising Moodle to new excellency levels.

          Or, if you prefer, yes, you fixed that boring issue.

          Thanks anyway! Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Yes, it's happening (somewhere in the French Polynesia, right now). And you did it, raising Moodle to new excellency levels. Or, if you prefer, yes, you fixed that boring issue. Thanks anyway! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: