Bug 24337 - Checkout note cannot be marked seen if more than 20 exist
Summary: Checkout note cannot be marked seen if more than 20 exist
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 24335
Blocks:
  Show dependency treegraph
 
Reported: 2020-01-03 14:58 UTC by Andrew Fuerste-Henry
Modified: 2020-01-13 23:34 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.02


Attachments
Bug 24337: Checkout note cannot be marked seen if more than 20 exist (1.59 KB, patch)
2020-01-03 20:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 24337: Checkout note cannot be marked seen if more than 20 exist (1.65 KB, patch)
2020-01-03 20:32 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24337: Checkout note cannot be marked seen if more than 20 exist (1.73 KB, patch)
2020-01-10 09:41 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2020-01-03 14:58:19 UTC
When there are more than 20 checkout notes in the system, Koha fails to attach actions to the Seen/Not Seen buttons for checkout notes that are not on the first page of notes at cgi-bin/koha/circ/checkout-notes.pl.

To Test:
- create 21 checkout notes
- go to cgi-bin/koha/circ/checkout-notes.pl
- inspect the Seen/Not Seen buttons on the 21st note, see that there is no event attached

I also filed bug 24335 while looking at this. I don't think it's related, but mentioning it just in case.
Comment 1 Owen Leonard 2020-01-03 19:19:26 UTC
I think the patch for Bug 24335 fixes this.

However, there remains the ambiguity about whether or not those batch operations will affect checked items which are not on the current "page" of the table. For instance:

- I check all items on the first page
- I navigate to the next page
- I check all the items on the second page
- I click the "Mark seen" button

Result: Only the checked items on the second page are marked seen.

One possible solution: A prompt asking the user whether they want to finish what they're doing before switching pages in the table.

I bring this up in case this bug should be repurposed to address that issue.
Comment 2 Andrew Fuerste-Henry 2020-01-03 19:44:05 UTC
I tried this while signing off on 24335. The Seen/Not Seen buttons on the second page still didn't work for me.
Comment 3 Owen Leonard 2020-01-03 20:09:06 UTC
Created attachment 96801 [details] [review]
Bug 24337: Checkout note cannot be marked seen if more than 20 exist

This patch modifies the event handler on the individual "Mark seen" /
"Mark unseen" buttons in the table of checkout notes. For an event to be
successfully attached to a hidden element it must be given a context.

To test you should have multiple checkout notes to work with, both seen
and unseen. Apply the patch and go to "Checkout notes pending" from the
staff client home page.

 - Navigate to the second "page" of data in the DataTable.
 - Test the functionality of the "Mark seen" and "Mark unseen" buttons.
   They should work correctly.
Comment 4 Owen Leonard 2020-01-03 20:10:13 UTC
(In reply to Andrew Fuerste-Henry from comment #2)
> The Seen/Not Seen buttons on the second page still didn't work for me.

Thanks Andrew, I misunderstood. Hopefully this patch works for you.
Comment 5 ByWater Sandboxes 2020-01-03 20:32:30 UTC
Created attachment 96802 [details] [review]
Bug 24337: Checkout note cannot be marked seen if more than 20 exist

This patch modifies the event handler on the individual "Mark seen" /
"Mark unseen" buttons in the table of checkout notes. For an event to be
successfully attached to a hidden element it must be given a context.

To test you should have multiple checkout notes to work with, both seen
and unseen. Apply the patch and go to "Checkout notes pending" from the
staff client home page.

 - Navigate to the second "page" of data in the DataTable.
 - Test the functionality of the "Mark seen" and "Mark unseen" buttons.
   They should work correctly.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 6 Andrew Fuerste-Henry 2020-01-03 20:33:30 UTC
In retrospect, I didn't describe it well. Signing off. Thanks!
Comment 7 Jonathan Druart 2020-01-10 09:41:05 UTC
Created attachment 97173 [details] [review]
Bug 24337: Checkout note cannot be marked seen if more than 20 exist

This patch modifies the event handler on the individual "Mark seen" /
"Mark unseen" buttons in the table of checkout notes. For an event to be
successfully attached to a hidden element it must be given a context.

To test you should have multiple checkout notes to work with, both seen
and unseen. Apply the patch and go to "Checkout notes pending" from the
staff client home page.

 - Navigate to the second "page" of data in the DataTable.
 - Test the functionality of the "Mark seen" and "Mark unseen" buttons.
   They should work correctly.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Martin Renvoize 2020-01-10 10:51:22 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 9 Joy Nelson 2020-01-12 19:13:51 UTC
Pushed to 19.11.x branch for 19.11.02
Comment 10 Lucas Gass 2020-01-13 23:34:36 UTC
backported to 19.05.x for 19.05.07