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

Make case-insensitive search in autocomplete element

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide
      1. apply patch suggested in the description
      2. go to edit any user profile page
      3. test that timezone search is case insensitive (or sensitive with the second patch)
      4. add some official tags with capital letters in Site administration > Appearance > Manage Tags
      5. edit course and make sure the tags are suggested when you type them without capital letters
      Show
      apply patch suggested in the description go to edit any user profile page test that timezone search is case insensitive (or sensitive with the second patch) add some official tags with capital letters in Site administration > Appearance > Manage Tags edit course and make sure the tags are suggested when you type them without capital letters
    • Affected Branches:
      MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull Master Branch:
      wip-MDL-51966-master

      Description

      I just tried to use autocomplete field on timezone field in user profile (the current selection is like 1000 elements), and realised that I have to type text case-sensitive

      Can we make an option for it? I would suggest case-insensitive by default.

      P.S. for testing:

      diff --git a/user/editlib.php b/user/editlib.php
      index 509a06d..016ddf0 100644
      --- a/user/editlib.php
      +++ b/user/editlib.php
      @@ -339,7 +339,7 @@ function useredit_shared_definition(&$mform, $editoroptions, $filemanageroptions
               $mform->setType('timezone', PARAM_TIMEZONE);
           } else {
               $choices = core_date::get_list_of_timezones($user->timezone, true);
      -        $mform->addElement('select', 'timezone', get_string('timezone'), $choices);
      +        $mform->addElement('autocomplete', 'timezone', get_string('timezone'), $choices);
           }
       
           // Multi-Calendar Support - see MDL-18375.
      

      For testing #2:

      $mform->addElement('autocomplete', 'timezone', get_string('timezone'), $choices, array('casesensitive' => true));
      

        Attachments

          Activity

            People

            Assignee:
            marina Marina Glancy
            Reporter:
            marina Marina Glancy
            Peer reviewer:
            Damyon Wiese
            Integrator:
            Andrew Nicols
            Tester:
            Simey Lameze
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              16/Nov/15