Moodle
  1. Moodle
  2. MDL-26925

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

    Details

    • Rank:
      16549

      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>'));
          }
          ...
      

        Issue Links

          Activity

          Hide
          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
          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
          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
          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
          Dan Poltawski added a comment -

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

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

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

          Show
          Dan Poltawski added a comment - Ah, I bet I couldn't reproduce it because I was pressing enter, updated teting instructions.
          Hide
          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
          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
          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
          Rossiani Wijaya added a comment -

          This is working as expected.

          Tested for 2.3, 2.4, 2.5 and master.

          Test passed.

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

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

          Closing as fixed!

          Show
          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: