Moodle
  1. Moodle
  2. MDL-31595

Enrol me in this course in Setting block visible for guests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2.2, 2.3
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Enrolments
    • Labels:
    • Testing Instructions:
      Hide

      1/ create course
      2/ enable guest access and enable self enrolment
      3/ login as guest account and verify the link is gone
      4/ login as normal user and verify the link is visible

      Show
      1/ create course 2/ enable guest access and enable self enrolment 3/ login as guest account and verify the link is gone 4/ login as normal user and verify the link is visible
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w11_MDL-31595_m23_enrolme
    • Rank:
      38159

      Description

      Steps to reproduce:
      1. Do not login.
      2. Go to course without guest access.
      3. "Enrol me in this course" link visible for guest.

      The link leads to the same page. It confuses people.

      1. Enrol_me.png
        33 kB
      2. Enrol_me.png
        62 kB

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          I think this was fixed a while ago.

          Show
          Michael de Raadt added a comment - I think this was fixed a while ago.
          Hide
          Artem Andreev added a comment -

          "Non-enrollable courses" is different case.
          Now bug exists on demo.moodle.net.
          Steps to reproduce:
          1. Set "Allow guest access" to No for course "Exchange Samples" (http://demo.moodle.net/course/view.php?id=604)
          2. Logout and try access course "Exchange Samples".
          See screenshot (sorry, I can't change language to English, Moodle always automatically changes it to Russian).

          Show
          Artem Andreev added a comment - "Non-enrollable courses" is different case. Now bug exists on demo.moodle.net. Steps to reproduce: 1. Set "Allow guest access" to No for course "Exchange Samples" ( http://demo.moodle.net/course/view.php?id=604 ) 2. Logout and try access course "Exchange Samples". See screenshot (sorry, I can't change language to English, Moodle always automatically changes it to Russian).
          Hide
          Artem Andreev added a comment -

          More correct screenshot

          Show
          Artem Andreev added a comment - More correct screenshot
          Hide
          Artem Andreev added a comment -

          Michael, I think you are mistaken when closing this issue as duplicate.

          Show
          Artem Andreev added a comment - Michael, I think you are mistaken when closing this issue as duplicate.
          Hide
          Michael de Raadt added a comment -

          Thanks for persisting with this, Artem.

          I've re-opened the issue.

          Show
          Michael de Raadt added a comment - Thanks for persisting with this, Artem. I've re-opened the issue.
          Hide
          Eloy Lafuente (stronk7) added a comment - - edited

          Side comment: While I think your patch is ok... wouldnt' be better to add the new conditions in the "} else

          {" part of the condition? After all, you've introduced it in the "unenrol" part, where this issue is about "enrol" (aka, the "}

          else {", isn't it?

          FYC, ciao

          Edited: Also, isguestuser() or is_guest(). I always have doubts here, grrr.

          Show
          Eloy Lafuente (stronk7) added a comment - - edited Side comment: While I think your patch is ok... wouldnt' be better to add the new conditions in the "} else {" part of the condition? After all, you've introduced it in the "unenrol" part, where this issue is about "enrol" (aka, the "} else {", isn't it? FYC, ciao Edited: Also, isguestuser() or is_guest(). I always have doubts here, grrr.
          Hide
          Petr Škoda added a comment - - edited

          isguestuser() is the one account that can not be enrolled in any course since 2.0, I think the "if" reflects that properly

          Show
          Petr Škoda added a comment - - edited isguestuser() is the one account that can not be enrolled in any course since 2.0, I think the "if" reflects that properly
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Then, perhaps, little detail... it would be worth putting the "// Unenrol link" comment some lines below, to keep the comment with its code or so. And keep your condition before it.

          Show
          Eloy Lafuente (stronk7) added a comment - Then, perhaps, little detail... it would be worth putting the "// Unenrol link" comment some lines below, to keep the comment with its code or so. And keep your condition before it.
          Hide
          Petr Škoda added a comment -

          comments improved, thanks!

          Show
          Petr Škoda added a comment - comments improved, thanks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks! (21, 22 & master)

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (21, 22 & master)
          Hide
          Ankit Agarwal added a comment -

          works as described.
          Passing.
          Thanks

          Show
          Ankit Agarwal added a comment - works as described. Passing. Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          FCT (fixed, closing, thanks). Ciao

          "I feel a very unusual sensation - if it is not indigestion, I think it must be gratitude!"
          ~ Benjamin Disraeli

          Show
          Eloy Lafuente (stronk7) added a comment - FCT (fixed, closing, thanks). Ciao "I feel a very unusual sensation - if it is not indigestion, I think it must be gratitude!" ~ Benjamin Disraeli

            People

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

              Dates

              • Created:
                Updated:
                Resolved: