Bug 27256 - "Add" button on point of sale page fails on table paging
Summary: "Add" button on point of sale page fails on table paging
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Martin Renvoize
QA Contact: Nick Clemens
URL:
Keywords:
Depends on: 26161
Blocks: 27289
  Show dependency treegraph
 
Reported: 2020-12-16 19:25 UTC by Martin Renvoize
Modified: 2021-12-13 21:09 UTC (History)
9 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:
21.05.00,20.11.01,20.05.07


Attachments
Bug 27256: Update click handler for point of sale (1.95 KB, patch)
2020-12-16 19:30 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27256: Update click handler for point of sale (2.00 KB, patch)
2020-12-17 19:14 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27256: Update click handler for point of sale (2.04 KB, patch)
2020-12-17 19:33 UTC, David Nind
Details | Diff | Splinter Review
Bug 27256: Update click handler for point of sale (2.10 KB, patch)
2020-12-21 14:12 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2020-12-16 19:25:19 UTC
The default paging for our DataTables is 20 items, so if we have more than 20 different items that can be sold via the point of sale page then the table of items will be paged.

The 'add' button works perfectly for the first page or results, but if you navigate to the second page, or filter/search the the table and find an item from a subsequent page, the add button does nothing.
Comment 1 Martin Renvoize 2020-12-16 19:30:34 UTC
Created attachment 114463 [details] [review]
Bug 27256: Update click handler for point of sale

This patch updates the click handler to bind to the table element in the
DOM as aposed to the individual buttons by their classes. We then use
the event propogation and filter on the button class to catch the clicks
we want.

Test plan
1/ Add 22 debit_types that can be sold to the system (or reduce the
datatable paging size)
2/ Confirm that items on the second page of results cannot be added for
sale on the point of sale page.
3/ Apply the patch
4/ Confirm items from the second table page can now be added correctly
5/ Clicking add when navigating to such an item should leave the items
table unmodified.
6/ Clicking aa when the table was filtered should reset the filters
bringing the table back to the first page
7/ Signoff
Comment 2 Owen Leonard 2020-12-17 19:14:46 UTC
Created attachment 114489 [details] [review]
Bug 27256: Update click handler for point of sale

This patch updates the click handler to bind to the table element in the
DOM as aposed to the individual buttons by their classes. We then use
the event propogation and filter on the button class to catch the clicks
we want.

Test plan
1/ Add 22 debit_types that can be sold to the system (or reduce the
datatable paging size)
2/ Confirm that items on the second page of results cannot be added for
sale on the point of sale page.
3/ Apply the patch
4/ Confirm items from the second table page can now be added correctly
5/ Clicking add when navigating to such an item should leave the items
table unmodified.
6/ Clicking aa when the table was filtered should reset the filters
bringing the table back to the first page
7/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 David Nind 2020-12-17 19:33:19 UTC
Created attachment 114490 [details] [review]
Bug 27256: Update click handler for point of sale

This patch updates the click handler to bind to the table element in the
DOM as aposed to the individual buttons by their classes. We then use
the event propogation and filter on the button class to catch the clicks
we want.

Test plan
1/ Add 22 debit_types that can be sold to the system (or reduce the
datatable paging size)
2/ Confirm that items on the second page of results cannot be added for
sale on the point of sale page.
3/ Apply the patch
4/ Confirm items from the second table page can now be added correctly
5/ Clicking add when navigating to such an item should leave the items
table unmodified.
6/ Clicking aa when the table was filtered should reset the filters
bringing the table back to the first page
7/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Nick Clemens 2020-12-21 14:12:27 UTC
Created attachment 114558 [details] [review]
Bug 27256: Update click handler for point of sale

This patch updates the click handler to bind to the table element in the
DOM as aposed to the individual buttons by their classes. We then use
the event propogation and filter on the button class to catch the clicks
we want.

Test plan
1/ Add 22 debit_types that can be sold to the system (or reduce the
datatable paging size)
2/ Confirm that items on the second page of results cannot be added for
sale on the point of sale page.
3/ Apply the patch
4/ Confirm items from the second table page can now be added correctly
5/ Clicking add when navigating to such an item should leave the items
table unmodified.
6/ Clicking aa when the table was filtered should reset the filters
bringing the table back to the first page
7/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Jonathan Druart 2020-12-26 17:15:47 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2020-12-28 14:58:49 UTC
Pushed to 20.11.x for 20.11.01
Comment 7 Andrew Fuerste-Henry 2020-12-28 21:43:25 UTC
Pushed to 20.05.x for 20.05.07
Comment 8 Victor Grousset/tuxayo 2020-12-31 21:28:53 UTC
Missing dependencies for 19.11.x, it doesn't affect it, no backport.