Bug 31566 - 'Patrons selected' counter doubles on 'Select all'
Summary: 'Patrons selected' counter doubles on 'Select all'
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 29971
Blocks:
  Show dependency treegraph
 
Reported: 2022-09-14 15:12 UTC by Martin Renvoize
Modified: 2023-06-08 22:28 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00


Attachments
Bug 31566: 'Patrons selected' counter doubles on 'Select all' (2.34 KB, patch)
2022-09-23 15:26 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 31566: 'Patrons selected' counter doubles on 'Select all' (2.39 KB, patch)
2022-09-23 17:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 31566: 'Patrons selected' counter doubles on 'Select all' (2.45 KB, patch)
2022-09-26 22:06 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2022-09-14 15:12:57 UTC
The new 'Patrons selected' feedback introduced on bug 29971 doesn't work as expected with the 'Select all' feature.. if you click "Select all" once it counts as expected.. if you work with the checkboxes, the counter changes as expected.. if you change your mind and click 'Select all' again, the counter adds all results again, effectively doubling the count each time you click it.
Comment 1 Owen Leonard 2022-09-23 15:26:37 UTC
Created attachment 140923 [details] [review]
Bug 31566: 'Patrons selected' counter doubles on 'Select all'

This patch refines the JavaScript which is run when the "Select all"
or "Clear all" controls are clicked. The script now checks to see
whether the checkbox is checked before triggering the change function.

To test, apply the patch and perform a patron search in the staff
interface which will return multiple results.

- After the patron search results are displayed, test the "Select
  all" control. The visible search results should all be checked,
  and the "Patrons selected" counter at the top should be
  incremented correctly.
- Clicking the "Select all" control again should have no effect.
  The "Patrons selected" counter should not increment again.
- Test the "Clear all" control to confirm that checkboxes are
  unchecked and the counter updates correctly.
- Test with multiple pages of patron search results to confirm
  that the controls work correctly on any page of results..
Comment 2 David Nind 2022-09-23 17:29:53 UTC
Created attachment 140959 [details] [review]
Bug 31566: 'Patrons selected' counter doubles on 'Select all'

This patch refines the JavaScript which is run when the "Select all"
or "Clear all" controls are clicked. The script now checks to see
whether the checkbox is checked before triggering the change function.

To test, apply the patch and perform a patron search in the staff
interface which will return multiple results.

- After the patron search results are displayed, test the "Select
  all" control. The visible search results should all be checked,
  and the "Patrons selected" counter at the top should be
  incremented correctly.
- Clicking the "Select all" control again should have no effect.
  The "Patrons selected" counter should not increment again.
- Test the "Clear all" control to confirm that checkboxes are
  unchecked and the counter updates correctly.
- Test with multiple pages of patron search results to confirm
  that the controls work correctly on any page of results..

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2022-09-23 17:33:35 UTC
Noted when testing:

- The dropdown list for 'Show X entries' has the options: 10 20 (default) 20 50 100 All 

- Note that 20 is repeated.

- This was there before the patch was applied, so not related to this bug and I should probably log as a separate one.
Comment 4 Katrin Fischer 2022-09-26 22:06:29 UTC
Created attachment 141016 [details] [review]
Bug 31566: 'Patrons selected' counter doubles on 'Select all'

This patch refines the JavaScript which is run when the "Select all"
or "Clear all" controls are clicked. The script now checks to see
whether the checkbox is checked before triggering the change function.

To test, apply the patch and perform a patron search in the staff
interface which will return multiple results.

- After the patron search results are displayed, test the "Select
  all" control. The visible search results should all be checked,
  and the "Patrons selected" counter at the top should be
  incremented correctly.
- Clicking the "Select all" control again should have no effect.
  The "Patrons selected" counter should not increment again.
- Test the "Clear all" control to confirm that checkboxes are
  unchecked and the counter updates correctly.
- Test with multiple pages of patron search results to confirm
  that the controls work correctly on any page of results..

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi 2022-10-03 16:53:25 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!