Moodle
  1. Moodle
  2. MDL-30518

custom checkboxes profile fields in signup form causes invalid $id parameter detection at signup time

    Details

    • Rank:
      33216

      Description

      Set debug level to DEVELOPER

      Go to Site administration > Users > Accounts > User profile fields

      Add a "checkbox" profile fields to the signup form with the following attributes:
      -> Is this field required? yes
      -> Display on signup page? yes
      -> Who is this field visible to? Visible to everyone

      Log out.

      Go to the signup form as non authenticated user.

      You see:

      context_system::instance(): invalid $id parameter detected, should be 0
      
          line 5532 of /lib/accesslib.php: call to debugging()
          line 6807 of /lib/accesslib.php: call to context_system::instance()
          line 32 of /user/profile/field/checkbox/field.class.php: call to get_context_instance()
          line 72 of /user/profile/lib.php: call to profile_field_checkbox->edit_field_add()
          line 477 of /user/profile/lib.php: call to profile_field_base->edit_field()
          line 103 of /login/signup_form.php: call to profile_signup_fields()
          line 154 of /lib/formslib.php: call to login_signup_form->definition()
          line 46 of /login/signup.php: call to moodleform->moodleform()
      

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this.

          I've put that on the backlog.

          In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.

          Show
          Michael de Raadt added a comment - Thanks for reporting this. I've put that on the backlog. In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.
          Hide
          Charles Fulton added a comment -

          MDL-29602 made the second parameter for get_context_instance redundant when getting CONTEXT_SYSTEM. Looks like a couple instances were overlooked.

          Patch: https://github.com/mackensen/moodle/compare/master...MDL-30518

          Show
          Charles Fulton added a comment - MDL-29602 made the second parameter for get_context_instance redundant when getting CONTEXT_SYSTEM. Looks like a couple instances were overlooked. Patch: https://github.com/mackensen/moodle/compare/master...MDL-30518
          Hide
          Rajesh Taneja added a comment -

          Thanks Charles, for providing the spot-on patch.
          Pushing it for integration review

          Show
          Rajesh Taneja added a comment - Thanks Charles, for providing the spot-on patch. Pushing it for integration review
          Hide
          Sam Hemelryk added a comment -

          Thanks guys this has been integrated now

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

          Raj can you please add some testing instructions

          Show
          Sam Hemelryk added a comment - Raj can you please add some testing instructions
          Hide
          Sam Hemelryk added a comment -

          Thanks Raj - tested and passed.

          Show
          Sam Hemelryk added a comment - Thanks Raj - tested and passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Yes, you did it!

          Now your code is part of the best weeklies released ever, many thanks!

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Yes, you did it! Now your code is part of the best weeklies released ever, many thanks! Closing, ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: