Uploaded image for project: '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

      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

        Gliffy Diagrams

        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
            jaseeey 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
            jaseeey 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
            jaseeey Jason Ilicic added a comment - Added patch to GitHub - https://github.com/jasonilicic/moodle/commit/6633055c10938365848a010dba81e06107071cb4
            Hide
            tsala Helen Foster added a comment -

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

            Show
            tsala Helen Foster added a comment - Jason, thanks for your comments and patch. Hoping one of our HQ devs can review it soon.
            Hide
            hchathi 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
            hchathi 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
            tsala 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
            tsala 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
            phalacee 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
            phalacee 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
            rajeshtaneja 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
            rajeshtaneja 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
            phalacee 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
            phalacee 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
            nebgor Aparup Banerjee added a comment -

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

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

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

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

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

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

            works perfectly!
            Test passed!
            Thanks!

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

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

            Ciao

            Show
            stronk7 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:
                  Fix Release Date:
                  28/Nov/11