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

Password unmask checkbox is not displayed

    Details

    • Testing Instructions:
      Hide
      1. Go to any course
      2. Enable self enrolment
      3. Click to edit the self enrolment settings
      4. Enter a password
      5. Make sure you can tick/untick 'Unmask' to show/hide the password
      6. Save the password
      7. Login as a student that is not yet enrolled in the course
      8. Browse to the course and self enrol
      9. When the password is asked, make sure you can use 'Unmask' to hide/unhide the password in the input field
      Show
      Go to any course Enable self enrolment Click to edit the self enrolment settings Enter a password Make sure you can tick/untick 'Unmask' to show/hide the password Save the password Login as a student that is not yet enrolled in the course Browse to the course and self enrol When the password is asked, make sure you can use 'Unmask' to hide/unhide the password in the input field
    • Workaround:
      Hide

      I've found another fix for this by editing: lib/form/yui/passwordunmask/passwordunmask.js

      I've added a check, if the parent note actually exists (which is not the case when students enrol themselves (/enrol/index.php)).
      So far I can't see any negative side effects from these changes:

      original:

      //Insert unmask div in the same div as password input.
      node.get('parentNode').insert(unmaskdiv, node.get('lastNode'));

      changed:

      //Insert unmask div in the same div as password input.
      if (node) { node.get('parentNode').insert(unmaskdiv, node.get('lastNode')); }

      Show
      I've found another fix for this by editing: lib/form/yui/passwordunmask/passwordunmask.js I've added a check, if the parent note actually exists (which is not the case when students enrol themselves (/enrol/index.php)). So far I can't see any negative side effects from these changes: original: //Insert unmask div in the same div as password input. node.get('parentNode').insert(unmaskdiv, node.get('lastNode')); changed: //Insert unmask div in the same div as password input. if (node) { node.get('parentNode').insert(unmaskdiv, node.get('lastNode')); }
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-33560-master

      Description

      When a student wants to self-enrol in a course with an enrolment key, the "Unmask" checkbox is not displayed. I don't know if this is intentional, but it breaks the JavaScript on that page.

      Firefox's Error Console shows:

      Error: node is null
      Source: .../theme/yui_combo.php?moodle/308/form/passwordunmask/passwordunmask.js

      Due to this, the navigation block can't be used any more.

        Gliffy Diagrams

        1. screenshot-1.jpg
          5 kB
        2. screenshot-2.jpg
          17 kB
        3. screenshot-3.jpg
          25 kB

          Activity

          Hide
          marxist Tobias Marx added a comment - - edited

          I've found another fix for this by editing: lib/form/yui/passwordunmask/passwordunmask.js

          I've added a check, if the parent note actually exists (which is not the case when students enrole themselves (/enrol/index.php)).
          So far I can't see any negative sideeffects from these changes:

          original:

          //Insert unmask div in the same div as password input.
          node.get('parentNode').insert(unmaskdiv, node.get('lastNode'));
          changed:

          //Insert unmask div in the same div as password input.
          if (node)

          { node.get('parentNode').insert(unmaskdiv, node.get('lastNode')); }
          Show
          marxist Tobias Marx added a comment - - edited I've found another fix for this by editing: lib/form/yui/passwordunmask/passwordunmask.js I've added a check, if the parent note actually exists (which is not the case when students enrole themselves (/enrol/index.php)). So far I can't see any negative sideeffects from these changes: original: //Insert unmask div in the same div as password input. node.get('parentNode').insert(unmaskdiv, node.get('lastNode')); changed: //Insert unmask div in the same div as password input. if (node) { node.get('parentNode').insert(unmaskdiv, node.get('lastNode')); }
          Hide
          marxist Tobias Marx added a comment -

          Editing enrolement key settings for self enrolment. There is an "Unmask" checkbox.

          Show
          marxist Tobias Marx added a comment - Editing enrolement key settings for self enrolment. There is an "Unmask" checkbox.
          Hide
          marxist Tobias Marx added a comment -

          Self enrol in a course as a student. There is no checkbox.

          Show
          marxist Tobias Marx added a comment - Self enrol in a course as a student. There is no checkbox.
          Hide
          marxist Tobias Marx added a comment -

          The JavaScript error in Firefox's error console.

          Show
          marxist Tobias Marx added a comment - The JavaScript error in Firefox's error console.
          Hide
          salvetore Michael de Raadt added a comment -

          Thanks for spotting that and providing a fix.

          Show
          salvetore Michael de Raadt added a comment - Thanks for spotting that and providing a fix.
          Hide
          fred Frédéric Massart added a comment - - edited

          Sprint planning.
          Estimated development difficulty: XS

          Thanks for your debugging Tobias. As you noticed 'node' was null, that was caused by the password field having an ID starting with a number and not a letter.

          Show
          fred Frédéric Massart added a comment - - edited Sprint planning. Estimated development difficulty: XS Thanks for your debugging Tobias. As you noticed 'node' was null, that was caused by the password field having an ID starting with a number and not a letter.
          Hide
          andyjdavis Andrew Davis added a comment -

          Looks good

          Show
          andyjdavis Andrew Davis added a comment - Looks good
          Hide
          fred Frédéric Massart added a comment -

          Cheers Andrew!

          Show
          fred Frédéric Massart added a comment - Cheers Andrew!
          Hide
          poltawski 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
          poltawski 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
          samhemelryk Sam Hemelryk added a comment -

          Thanks guys, fix looked perfect and has been integrated now

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks guys, fix looked perfect and has been integrated now
          Hide
          ankit_frenz Ankit Agarwal added a comment -

          Forgot to click the button.
          It is working great.
          Thanks!

          Show
          ankit_frenz Ankit Agarwal added a comment - Forgot to click the button. It is working great. Thanks!
          Hide
          nebgor Aparup Banerjee added a comment -

          yay, it works!

          This issue has been put through rigorous processes and finally swam upstream along with some 65 others this week.

          Thank you all for taking the time to get us here.

          cheers!

          Show
          nebgor Aparup Banerjee added a comment - yay, it works! This issue has been put through rigorous processes and finally swam upstream along with some 65 others this week. Thank you all for taking the time to get us here. cheers!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/12