Moodle
  1. Moodle
  2. MDL-24200

Browse list of users focusses on 'Show advanced' button instead of 'Add filter'

    Details

    • Testing Instructions:
      Hide
      1. go to admin/user.php within your moodle instance (with javascript enabled)
      2. use firebug or equiv to check that the "show advanced" button is now a button and not a submit
      3. type text into the filter input text box
      4. hit enter on the keyboard

      The results should be filtered

      Show
      go to admin/user.php within your moodle instance (with javascript enabled) use firebug or equiv to check that the "show advanced" button is now a button and not a submit type text into the filter input text box hit enter on the keyboard The results should be filtered
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-24200-master
    • Rank:
      6302

      Description

      Steps to recreate:

      1. In admin/user.php enter a name
      2. Click the enter/return button on your keyboard

      Expected result: Search results are returned (i.e. behaviour as in 1.9)

      Actual result: Focus moves to the 'Show advanced' button

      1. 20110112-Fix_Default_Button_For_User_Search.patch
        0.8 kB
        Jason Ilicic
      2. MDL-24200.patch
        0.5 kB
        Hubert Chathi

        Issue Links

          Activity

          Hide
          Jason Ilicic added a comment -

          Issue occurs because there are two submit buttons within the form, where HTML will automatically force the default button to be the first of type 'submit' in the form. There is no way to choose a default button in HTML as this has not yet been implemented, but a way to work around it is by setting the "Show/hide advanced" button to type 'button', so "Add filter" is the first in order of type 'submit'.

          Show
          Jason Ilicic added a comment - Issue occurs because there are two submit buttons within the form, where HTML will automatically force the default button to be the first of type 'submit' in the form. There is no way to choose a default button in HTML as this has not yet been implemented, but a way to work around it is by setting the "Show/hide advanced" button to type 'button', so "Add filter" is the first in order of type 'submit'.
          Show
          Jason Ilicic added a comment - Added patch to GitHub - https://github.com/jasonilicic/moodle/commit/6633055c10938365848a010dba81e06107071cb4
          Hide
          Helen Foster added a comment -

          Jason, thanks for your comments and patch. Hoping one of our HQ devs can review it soon.

          Show
          Helen Foster added a comment - Jason, thanks for your comments and patch. Hoping one of our HQ devs can review it soon.
          Hide
          Hubert Chathi added a comment - - edited

          We can't just change the type from submit to button in forsmlib – otherwise it will break the functionality for people who are not using JavaScript. Attached is a patch (MDL-24200.patch) that will change the type within the JavaScript itself.

          Show
          Hubert Chathi added a comment - - edited We can't just change the type from submit to button in forsmlib – otherwise it will break the functionality for people who are not using JavaScript. Attached is a patch ( MDL-24200 .patch) that will change the type within the JavaScript itself.
          Hide
          Helen Foster added a comment -

          Thanks Hubert. I run into this bug at least once a day so would love for it to be fixed!

          Show
          Helen Foster added a comment - Thanks Hubert. I run into this bug at least once a day so would love for it to be fixed!
          Hide
          Jason Fowler added a comment -

          Well, I've had a play with this, and Hubert's patch works while Javascript is on, but more work needs to be done to fix it over all. Basically, the way the forms are expanded through-out Moodle would need to be looked into to fix this issue.

          Show
          Jason Fowler added a comment - Well, I've had a play with this, and Hubert's patch works while Javascript is on, but more work needs to be done to fix it over all. Basically, the way the forms are expanded through-out Moodle would need to be looked into to fix this issue.
          Hide
          Rajesh Taneja added a comment - - edited

          This is a partial solution, which will work for browsers with JS.
          After discussion with you, I think it is fine to have this partial fix and have a new bug to write "show advance" functionality to handle this situation in non-js supported browsers.

          Also, please backport this as well.

          Show
          Rajesh Taneja added a comment - - edited This is a partial solution, which will work for browsers with JS. After discussion with you, I think it is fine to have this partial fix and have a new bug to write "show advance" functionality to handle this situation in non-js supported browsers. Also, please backport this as well.
          Hide
          Jason Fowler added a comment -

          my ideal way of handling it would be to render the whole form, and then use Javascript to hide parts of the form for the advanced view, and add a button that when clicked uses javascript to reveal the hidden parts form. That way if javascript is off, those parts of the form are there already, and the "Show Advanced" button is not needed

          Show
          Jason Fowler added a comment - my ideal way of handling it would be to render the whole form, and then use Javascript to hide parts of the form for the advanced view, and add a button that when clicked uses javascript to reveal the hidden parts form. That way if javascript is off, those parts of the form are there already, and the "Show Advanced" button is not needed
          Hide
          Aparup Banerjee added a comment -

          Hi Jason, failing this as discussed.
          js error: this._advButtons.set is not a function

          Show
          Aparup Banerjee added a comment - Hi Jason, failing this as discussed. js error: this._advButtons.set is not a function
          Hide
          Rajesh Taneja added a comment -

          Patch works fine now...
          Patch provided by Hubert is spot-on

          Show
          Rajesh Taneja added a comment - Patch works fine now... Patch provided by Hubert is spot-on
          Hide
          Aparup Banerjee added a comment -

          Thanks for looking at this guys, its been integrated and is up for testing.

          Show
          Aparup Banerjee added a comment - Thanks for looking at this guys, its been integrated and is up for testing.
          Hide
          Ankit Agarwal added a comment -

          works perfectly!
          Test passed!
          Thanks!

          Show
          Ankit Agarwal added a comment - works perfectly! Test passed! Thanks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Yes, you got this finally upstream, just in time for Moodle 2.2beta. Congrats and thanks!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Yes, you got this finally upstream, just in time for Moodle 2.2beta. Congrats and thanks! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: