Bug 38607

Summary: CART notice issues
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: OPACAssignee: Lisette Scheer <lisette>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: david
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 3150    
Bug Blocks:    
Attachments: Bug 38607: CART notice issues

Description Nick Clemens (kidclamp) 2024-12-03 16:13:54 UTC
To recreate:
Find a record with a subtitle, edit and save to ensure the subtitle field is populated
Add it to a cart on the OPAC
open the cart and send
If your Koha doesn't send emails, just check the message queue:
SELECT * FROM message_queue;
Notice the subtitle has no spaces

The cart template has:
[% FOREACH subtitle IN biblio.subtitle.split(" | ") %]

Changing to split only on | seems to work:
[% FOREACH subtitle IN biblio.subtitle.split("|") %]
Comment 1 Nick Clemens (kidclamp) 2024-12-03 16:26:11 UTC
This seems to be the best fix, need to escape the characters:
[% IF ( biblio.subtitle ) %][% FOREACH subtitle IN biblio.subtitle.split('\ \|\ ') %][% subtitle | html %][% END %][% END %]
Comment 2 Lisette Scheer 2024-12-03 20:46:12 UTC
Created attachment 175095 [details] [review]
Bug 38607: CART notice issues

When sending carts, spaces are removed from subtitles and if there is a shelving location but no call number there isn't a space between the shelving location and the item barcode.

Test plan:
1. Find an item with a subtitle
2. Make sure the account you're using has an email address
3. Add it to your cart in the OPAC
4. Send the cart to yourself
5. In the staff interface, create and run this report:
SELECT * FROM message_queue;
6. Notice the subtitle has no spaces and there isn't a space between the location and the barcode
7. Apply the patch
8. Go to the notice in the staff interface and select "view default notice"
9. Copy the default into your notice and save.
10. Repeat steps 4 & 5
11. Observe that the spacing is now correct.
Comment 3 David Nind 2024-12-04 22:14:18 UTC
I've failed QA after testing using KTD:

1. Before the patch, if a record as a " :" at the end of the title (245$a) and a subtitle (245$b):
   . In the cart: it only lists the main part of the title (with a space then : after it)
   . The message: doesn't include the subtitle, and doesn't have the :

2. If I removed the " :" from the record, everything matches the behavour described in the bug.

3. After the patch, if a record has a " :"
   . In the cart: displays correctly
   . In the message: doesn't include the " :" between the title and subtitle

4. The patch fixes the space between the location and the barcode.
     Items:
     - Fairview , General stacks 39999000006094

5. But notice that there is still a space between the library and the comma.

I used record this record to test: 146 - The definitive guide to Catalyst : writing extensible, scalable, and maintainable Perl-based Web applications / Kieren Diment and Matt S. Trout ; with Eden Cardim, Jay Kuri, and Jess Robinson.