Bug 28560 - Slash with non-ascii library code breaks various things
Summary: Slash with non-ascii library code breaks various things
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-13 19:10 UTC by Victor Grousset/tuxayo
Modified: 2021-07-14 23:48 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Grousset/tuxayo 2021-06-13 19:10:08 UTC
== Test plan ==
create a library with code ko/ha and another with Ä/A

A. 
1. Try to hold from the OPAC with delivery to ko/ha
2. => ERROR: Internal error: incomplete hold request.
(odd, nothing in all the logs, just a happy HTTP request returning 200)

B.
1. Staff interface
2. set library: Ä/A (the slash isn't enought to cause issues)
3. transfer item to any another library
4. => Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line 88
Oddly it works with ko/ha

C.
1. Staff interface
2. set library: Ä/A (the slash isn't enought to cause issues)
3. checkout an item
4. => Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line 88
Oddly it works with ko/ha

D.
1. Staff interface
2. set library: NOT Ä/A
3. checkout an item
4. set library: Ä/A
5. partron page => checkout tab => show checkouts
6. try to check in
7. => it's loads for ever
8. => logs: Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line 88
9. refresh page
10. The item has actually been checked in. (not sure if DB is in a consistent state)

E.
Same but use the check in tab of the search box, next to the Koha logo
Comment 1 Victor Grousset/tuxayo 2021-06-13 19:13:46 UTC
tested on
- a sandbox
- Debian 11 with MariaDB 10.5
- Debian 10 (or 9) with MariaDB 10.1
Comment 2 Katrin Fischer 2021-06-13 20:15:57 UTC
Could this be the same issue as the CGI::Session issue?
Comment 3 Victor Grousset/tuxayo 2021-06-13 22:19:58 UTC
I was able to fail these test plans with the patches↓↓ applied.

I forgot to say that it was a follow up of bug 28489 comment 24
Comment 4 Jonathan Druart 2021-06-23 09:28:32 UTC
(In reply to Victor Grousset/tuxayo from comment #0)
> == Test plan ==
> create a library with code ko/ha and another with Ä/A
> 
> A. 
> 1. Try to hold from the OPAC with delivery to ko/ha
> 2. => ERROR: Internal error: incomplete hold request.
> (odd, nothing in all the logs, just a happy HTTP request returning 200)

There is something silly in opac-reserve.pl

211         my $branch = $query->param('branch');
212         $selectedItems = "$bib/$item/$branch/";
213     }   
214     
215     $selectedItems =~ s!/$!!;
216     my @selectedItems = split /\//, $selectedItems, -1;
217     
218     # Make sure there is a biblionum/itemnum/branch triplet for each item.
219     # The itemnum can be 'any', meaning next available.
220     my $selectionCount = @selectedItems;
221     if (($selectionCount == 0) || (($selectionCount % 3) != 0)) {

We are using '/' to separate the hold info.

Because multi holds code does the same in .tt
Around
642             $(".confirmjs:checked").each(function() {


The whole thing needs a rewrite and its own bug report.

> B.
> 1. Staff interface
> 2. set library: Ä/A (the slash isn't enought to cause issues)
> 3. transfer item to any another library
> 4. => Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line
> 88
> Oddly it works with ko/ha

Please detail the steps.

> C.
> 1. Staff interface
> 2. set library: Ä/A (the slash isn't enought to cause issues)
> 3. checkout an item
> 4. => Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line
> 88
> Oddly it works with ko/ha

Cannot recreate this.

> D.
> 1. Staff interface
> 2. set library: NOT Ä/A
> 3. checkout an item
> 4. set library: Ä/A
> 5. partron page => checkout tab => show checkouts
> 6. try to check in
> 7. => it's loads for ever
> 8. => logs: Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm
> line 88
> 9. refresh page
> 10. The item has actually been checked in. (not sure if DB is in a
> consistent state)

Cannot recreate.

> E.
> Same but use the check in tab of the search box, next to the Koha logo

Cannot recreate.


The question is, do we really want to support / in code? I don't think so.
Comment 5 Victor Grousset/tuxayo 2021-07-14 07:03:16 UTC
> Cannot recreate.

There is still that mystery... >_<

> The question is, do we really want to support / in code? I don't think so.

Same, so => won't fix?


This ticket was just opened to extract these unrelated things found when testing bug 28489