Bug 10753

Summary: Don't use _ANY_ as branchcode when creating suggestions for 'Any library'
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: abl, chris, fridolin.somers, jonathan.druart, kyle, liz, mtj, paola.rossi, tomascohen
Version: 3.18   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10449
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14839
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22905
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 10449, 13484    
Attachments: Bug 10753: Any library is represented by an empty string
Bug 10753: Any library is represented by an empty string
Bug 10753: Any library is represented by an empty string
[PASSED QA] Bug 10753: Any library is represented by an empty string

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 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 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