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

Custom Profile Field Shortnames Getting Silently re-written

XMLWordPrintable

    • MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MDL-63068_master
    • Hide

      Moving shortname value validation to validate() function, and validating as 

      PARAM_ALPHANUMEXT to allow underscore apart from letters and numbers.

      Show
      Moving shortname value validation to validate() function, and validating as  PARAM_ALPHANUMEXT to allow underscore apart from letters and numbers.
    • Hide
      1. As an admin go to Site administration -> Users -> User profile fields
      2. Create a new profile field (any type) and add a shortname with letters, numbers and underscore.
      3. Save changes
      4. Edit created profile field
      5. TEST: Check the name is the one you have just written
      6. Edit an existing field
      7. Change shortname to a new value using letters, numbers and underscore
      8. Save changes
      9. Edit created profile field
      10. TEST: Check the name is the one you have just written
      11. Create a new profile field (any type) and add a shortname with not allowed symbols such as dash (minus symbol), spaces or anything but letters, numbers or underscore.
      12. TEST: Check you are getting an error when you try to Save changes and you are not creating new field
      Show
      As an admin go to Site administration -> Users -> User profile fields Create a new profile field (any type) and add a shortname with letters, numbers and underscore. Save changes Edit created profile field TEST: Check the name is the one you have just written Edit an existing field Change shortname to a new value using letters, numbers and underscore Save changes Edit created profile field TEST: Check the name is the one you have just written Create a new profile field (any type) and add a shortname with not allowed symbols such as dash (minus symbol), spaces or anything but letters, numbers or underscore. TEST: Check you are getting an error when you try to Save changes and you are not creating new field

      When editing a custom profile field with a shortname that contains an underscore the underscore gets silently stripped when ever the field is edited.

      If underscores are not allowed then there should be an error, not a silent stripping, and if they are allowed they should not be stripped.

      I just spent 3 hours trying to figure out why my web services calls to create users with a field ad_dn suddenly stopped working. It was because editing the field resulted in it being renamed to addn!

            amaia Amaia Anabitarte
            bbusschots Bart Busschots
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.