Bug 10753 - Don't use _ANY_ as branchcode when creating suggestions for 'Any library'
Summary: Don't use _ANY_ as branchcode when creating suggestions for 'Any library'
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: 3.18
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 10449 13484
  Show dependency treegraph
 
Reported: 2013-08-18 19:56 UTC by Katrin Fischer
Modified: 2019-05-14 15:54 UTC (History)
9 users (show)

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


Attachments
Bug 10753: Any library is represented by an empty string (2.43 KB, patch)
2014-12-11 11:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10753: Any library is represented by an empty string (2.43 KB, patch)
2014-12-15 11:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10753: Any library is represented by an empty string (2.54 KB, patch)
2014-12-15 11:39 UTC, Paola Rossi
Details | Diff | Splinter Review
[PASSED QA] Bug 10753: Any library is represented by an empty string (2.53 KB, patch)
2014-12-19 13:50 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2013-08-18 19:56:42 UTC
The staff interface allows creating suggestions for "Any library". In this case the branchcode used in the suggestions table is _ANY_.

I think this creates a few problem. I think one will be that we can't create a FK constraint on the branchcode for the suggestions table. It would also be more consistent with other code in Koha to use an empty branchcode for any library.
Comment 1 Liz Rea 2013-11-11 00:51:54 UTC
Should we add a branch at install, that is the equivalent of any in the code, that cannot be deleted? Basically a shadow branch, just for this purpose?
Comment 2 Jonathan Druart 2014-12-11 11:10:42 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-12-11 11:12:03 UTC
I am under the impression that this simple patch fixes the problem.
Someone to confirm?
Comment 4 Paola Rossi 2014-12-15 11:04:05 UTC
I've applied the patch against master 3.19.00.000

There are some [and case?] errors in the patch:

Web installer › Step 3
Updating database structure

Update errors :

    [Mon Dec 15 11:56:05 2014] updatedatabase.pl: Global symbol "$dbversion" requires explicit package name at /var/root-koha/..../installer/data/mysql/updatedatabase.pl line 9588.
    [Mon Dec 15 11:56:05 2014] updatedatabase.pl: Global symbol "$dbversion" requires explicit package name at /var/root-koha/..../installer/data/mysql/updatedatabase.pl line 9589.
    [Mon Dec 15 11:56:05 2014] updatedatabase.pl: Global symbol "$dbversion" requires explicit package name at /var/root-koha/.../installer/data/mysql/updatedatabase.pl line 9593.
    [Mon Dec 15 11:56:05 2014] updatedatabase.pl: Global symbol "$dbversion" requires explicit package name at /var/root-koha/..../installer/data/mysql/updatedatabase.pl line 9594.
    [Mon Dec 15 11:56:05 2014] updatedatabase.pl: Execution of /var/root-koha/..../installer/data/mysql/updatedatabase.pl aborted due to compilation errors.

I pass the patch to "Failed QA" status.
Comment 5 Jonathan Druart 2014-12-15 11:18:32 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2014-12-15 11:19:04 UTC
(In reply to Paola Rossi from comment #4)
> I've applied the patch against master 3.19.00.000
> 
> There are some [and case?] errors in the patch:
> 
> Web installer › Step 3
> Updating database structure
> 
> Update errors :

Sorry about that.
Comment 7 Paola Rossi 2014-12-15 11:39:57 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall (khall) 2014-12-19 13:50:31 UTC
Created attachment 34538 [details] [review]
[PASSED QA] Bug 10753: Any library is represented by an empty string

And not with "__ANY__"

Test plan:
0/ Don't apply this patch
1/ Create a suggestion for "any library"
2/ Verify suggestions.branchcode contain "__ANY__"
3/ Apply this patch and execute the updatedb entry
4/ Create a suggestion for "any library"
5/ Verify suggestions.branchcode contain "" (for both suggestions).

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Tomás Cohen Arazi (tcohen) 2014-12-19 21:00:28 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 10 Chris Cormack 2014-12-19 23:54:27 UTC
Template changes, held for 3.18.3
Comment 11 Chris Cormack 2014-12-25 19:08:06 UTC
Pushed to 3.18.x will be in 3.18.3
Comment 12 Mason James 2015-01-16 19:06:14 UTC
Contains DB changes, passing for 3.16.x