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

Empty user selector result set from AJAX response does not present feedback

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.3.8, 2.4.5, 2.5.1
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide
      1. Login as Admin
      2. Go to Admin > Users > Permissions
      3. type in some random jibberish in one of the search boxes. DO NOT PRESS ENTER (wait for the ajax to load it)
      4. VERIFY: the search box should say 'No users match 'random jibberish'
      5. Enter some text which matches a user
      6. Verify the list is updated to show that
      Show
      Login as Admin Go to Admin > Users > Permissions type in some random jibberish in one of the search boxes. DO NOT PRESS ENTER (wait for the ajax to load it) VERIFY: the search box should say 'No users match 'random jibberish' Enter some text which matches a user Verify the list is updated to show that
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-26925-master

      Description

      In any user selector, for example the site administrators configuration page, enter into the search field some random nonsense that is expected to return no results. The AJAX refresh of the list box presents an empty box where it should present the "No users match 'xxx'" message.

      A solution for this is to add the line indicated below in user/selector/module.js at line 252:

          ...
          } else {
              optgroup.set('label', groupname); /////ADDED
              optgroup.append(Y.Node.create('<option disabled="disabled">\u00A0</option>'));
          }
          ...
      

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            poltawski Dan Poltawski added a comment -

            Hi Jonathon, I'm afraid I can't reproduce this issue - could you give any more details? Is this still occuring - the No users match is working for me

            Show
            poltawski Dan Poltawski added a comment - Hi Jonathon, I'm afraid I can't reproduce this issue - could you give any more details? Is this still occuring - the No users match is working for me
            Hide
            jonof Jonathon Fowler added a comment -

            Hi Dan, this should reproduce the problem as I'm experiencing it:

            First, this is how I expect it should work:

            • Disable JavaScript in your browser and go to /admin/roles/admins.php.
            • Then, in the 'Users' search box enter some nonsense text and press the 'Search' button.
            • The page will reload with "No users match 'asdfgh'" showing in the 'Users' list box.

            This is what it actually does:

            • Re-enable JavaScript in your browser and go to /admin/roles/admins.php.
            • Then, in the 'Users' search box enter some nonsense text and wait for the AJAX refresh.
            • The list box will be empty, ie. no "No users match 'asdfgh'" in the list box.

            Adding the line I mentioned in the report presents the "No users match" message just as the non-AJAX version does.

            Show
            jonof Jonathon Fowler added a comment - Hi Dan, this should reproduce the problem as I'm experiencing it: First, this is how I expect it should work: Disable JavaScript in your browser and go to /admin/roles/admins.php. Then, in the 'Users' search box enter some nonsense text and press the 'Search' button. The page will reload with "No users match 'asdfgh'" showing in the 'Users' list box. This is what it actually does: Re-enable JavaScript in your browser and go to /admin/roles/admins.php. Then, in the 'Users' search box enter some nonsense text and wait for the AJAX refresh. The list box will be empty, ie. no "No users match 'asdfgh'" in the list box. Adding the line I mentioned in the report presents the "No users match" message just as the non-AJAX version does.
            Hide
            poltawski Dan Poltawski added a comment -

            Hmm interesting - thanks. I can reproduce this now. I wonder why I couldn't before

            Show
            poltawski Dan Poltawski added a comment - Hmm interesting - thanks. I can reproduce this now. I wonder why I couldn't before
            Hide
            poltawski Dan Poltawski added a comment -

            Ah, I bet I couldn't reproduce it because I was pressing enter, updated teting instructions.

            Show
            poltawski Dan Poltawski added a comment - Ah, I bet I couldn't reproduce it because I was pressing enter, updated teting instructions.
            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, this has been integrated now.

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks guys, this has been integrated now.
            Hide
            rwijaya Rossiani Wijaya added a comment -

            This is working as expected.

            Tested for 2.3, 2.4, 2.5 and master.

            Test passed.

            Show
            rwijaya Rossiani Wijaya added a comment - This is working as expected. Tested for 2.3, 2.4, 2.5 and master. Test passed.
            Hide
            marina Marina Glancy added a comment -

            Thanks for your awesome work! This has now become a part of Moodle.

            Closing as fixed!

            Show
            marina Marina Glancy added a comment - Thanks for your awesome work! This has now become a part of Moodle. Closing as fixed!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/13