Bug 28838 - SCO impossible errors are hard to target with CSS/JS
Summary: SCO impossible errors are hard to target with CSS/JS
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-10 14:17 UTC by Lucas Gass
Modified: 2021-09-03 14:55 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
This patch adds unique IDs to the SCO main page so the impossible errors can easily be targeted via JS and CSS.
Version(s) released in:
21.11.00


Attachments
Bug 28838: add unique IDs to sco-main.tt impossible errors (6.05 KB, patch)
2021-08-10 14:23 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 28838: add unique IDs to sco-main.tt impossible errors (6.11 KB, patch)
2021-08-11 11:28 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28838: add unique IDs to sco-main.tt impossible errors (6.17 KB, patch)
2021-08-29 11:54 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 Lucas Gass 2021-08-10 14:17:12 UTC
On sco-main.tt if a patron checks out something that is 'impossible' to check out via SCO they are presented with one of many reasons why the item cannot be checked out:

The system does not recognize this barcode.
You have checked out too many items and can't check out any more.
This item is checked out to someone else.
You cannot renew this item again.
This item is not for loan.
You owe the library [% DEBT | $Price %] and cannot check out.
This item has been withdrawn from the collection.
This item is restricted.
This item is on hold for another patron.
This item belongs to another branch.
Your account has expired.
Your account has been suspended.
This card has been declared lost.
Your contact information seems to be incomplete.
Due date is not valid.
Item must be checked out at a circulation desk.

If we could wrap each of these messages in a span with a unique ID it will be easier to change text/target each individual message with CSS/JS.
Comment 1 Lucas Gass 2021-08-10 14:23:05 UTC
Created attachment 123700 [details] [review]
Bug 28838: add unique IDs to sco-main.tt impossible errors

To test:
1. Apply patch
2. Go SCO and try to checkout some items that will generate some of the following errors:

The system does not recognize this barcode.
You have checked out too many items and can't check out any more.
This item is checked out to someone else.
You cannot renew this item again.
This item is not for loan.
You owe the library [% DEBT | $Price %] and cannot check out.
This item has been withdrawn from the collection.
This item is restricted.
This item is on hold for another patron.
This item belongs to another branch.
Your account has expired.
Your account has been suspended.
This card has been declared lost.
Your contact information seems to be incomplete.
Due date is not valid.
Item must be checked out at a circulation desk.

3. The display should be exactly as it was without the patch but if you use the browsers dev tools you should be able to inscept each error message and see that it is now wrapped in a <span> with an ID.
Comment 2 Owen Leonard 2021-08-11 11:28:50 UTC
Created attachment 123781 [details] [review]
Bug 28838: add unique IDs to sco-main.tt impossible errors

To test:
1. Apply patch
2. Go SCO and try to checkout some items that will generate some of the
   following errors:

The system does not recognize this barcode.
You have checked out too many items and can't check out any more.
This item is checked out to someone else.
You cannot renew this item again.
This item is not for loan.
You owe the library [% DEBT | $Price %] and cannot check out.
This item has been withdrawn from the collection.
This item is restricted.
This item is on hold for another patron.
This item belongs to another branch.
Your account has expired.
Your account has been suspended.
This card has been declared lost.
Your contact information seems to be incomplete.
Due date is not valid.
Item must be checked out at a circulation desk.

3. The display should be exactly as it was without the patch but if you
   use the browsers dev tools you should be able to inscept each error
   message and see that it is now wrapped in a <span> with an ID.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Katrin Fischer 2021-08-29 11:54:35 UTC
Created attachment 124227 [details] [review]
Bug 28838: add unique IDs to sco-main.tt impossible errors

To test:
1. Apply patch
2. Go SCO and try to checkout some items that will generate some of the
   following errors:

The system does not recognize this barcode.
You have checked out too many items and can't check out any more.
This item is checked out to someone else.
You cannot renew this item again.
This item is not for loan.
You owe the library [% DEBT | $Price %] and cannot check out.
This item has been withdrawn from the collection.
This item is restricted.
This item is on hold for another patron.
This item belongs to another branch.
Your account has expired.
Your account has been suspended.
This card has been declared lost.
Your contact information seems to be incomplete.
Due date is not valid.
Item must be checked out at a circulation desk.

3. The display should be exactly as it was without the patch but if you
   use the browsers dev tools you should be able to inscept each error
   message and see that it is now wrapped in a <span> with an ID.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2021-08-30 15:12:21 UTC
Pushed to master for 21.11, thanks to everybody involved!