Bug 21746

Summary: Remove NO_LIBRARY_SET
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, katrin.fischer, mtompset
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Bug Depends on: 20489    
Bug Blocks: 25765    
Attachments: Bug 21746: Remove NO_LIBRARY_SET
Bug 21746: Remove LoginBranchname and LoginBranchcode
Bug 21746: Remove GetLoggedInBranchcode
Bug 21746: Remove 3 more uneeded variables from C4::Auth
Bug 21746: Remove NO_LIBRARY_SET
Bug 21746: Remove NO_LIBRARY_SET
Bug 21746: Remove NO_LIBRARY_SET

Description Jonathan Druart 2018-11-01 14:02:16 UTC
NO_LIBRARY_SET was used when the DB user was logged in. Since bug 20489 it's not longer possible. We could remove the code.

We also have 2 TT variables: LoginBranchcode, LoginBranchname
And 1 template method, Branches.GetLoggedInBranchcode.
We could simplify and unify that code
Comment 1 Mark Tompsett 2018-11-02 02:09:28 UTC
NO_LIBRARY_SET is also used for the initial web install, which requires the DB user. So, probably not entirely removing NO_LIBRARY_SET, because the branches table won't even exist at the initial web install.
Comment 2 Katrin Fischer 2019-02-04 22:43:54 UTC
I can confirm it's fixed now - looks like we forgot to close the bug!
Comment 3 Katrin Fischer 2019-02-04 22:45:06 UTC
(In reply to Katrin Fischer from comment #2)
> I can confirm it's fixed now - looks like we forgot to close the bug!

Sorry, wrong bug!
Comment 4 Jonathan Druart 2020-02-14 12:07:44 UTC
Created attachment 98934 [details] [review]
Bug 21746: Remove NO_LIBRARY_SET

NO_LIBRARY_SET was used when the DB user was logged in. Since bug 20489
it's not longer possible. We could remove the code.

One occurrence left in C4::InstallAuth as there is no (real) logged in user yet.
Comment 5 Jonathan Druart 2020-02-14 12:07:47 UTC
Created attachment 98935 [details] [review]
Bug 21746: Remove LoginBranchname and LoginBranchcode

Those 2 variables can be replaced by logged_in_user that is passed to
all the template via C4::Auth
Comment 6 Jonathan Druart 2020-02-14 12:07:50 UTC
Created attachment 98936 [details] [review]
Bug 21746: Remove GetLoggedInBranchcode

This method from the Branches TT plugin is not needed as we can use
logged_in_user
Comment 7 Jonathan Druart 2020-02-14 12:07:54 UTC
Created attachment 98937 [details] [review]
Bug 21746: Remove 3 more uneeded variables from C4::Auth

They are not used in the templates
Comment 8 Jonathan Druart 2020-02-14 12:10:11 UTC
Test plan:
* Install Koha to make sure NO_LIBRARY_SET is not needed during the install process
* Loggin into Koha
* Make sure the your library's name is displayed correctly in the header
* Set another library
* Confirm that the library's name is updated

Other occurrences will be check by QA that will make sure there is no typo in the patches
Comment 9 Owen Leonard 2020-02-14 14:27:07 UTC
(In reply to Jonathan Druart from comment #8)
> Test plan:
> * Confirm that the library's name is updated

This didn't work in my test. The previous library name still showed up.
Comment 10 Jonathan Druart 2020-02-17 10:19:09 UTC
Created attachment 99071 [details] [review]
Bug 21746: Remove NO_LIBRARY_SET

NO_LIBRARY_SET was used when the DB user was logged in. Since bug 20489
it's not longer possible. We could remove the code.

One occurrence left in C4::InstallAuth as there is no (real) logged in user yet.

Test plan:
* Install Koha to make sure NO_LIBRARY_SET is not needed during the
install process
* Login into Koha
* Make sure the your library's name is displayed correctly in the header
* Set another library
* Confirm that the library's name is updated
Comment 11 Jonathan Druart 2020-02-17 10:20:19 UTC
(In reply to Owen Leonard from comment #9)
> (In reply to Jonathan Druart from comment #8)
> > Test plan:
> > * Confirm that the library's name is updated
> 
> This didn't work in my test. The previous library name still showed up.

Yes, sorry about that. I revived patches I had on a local branch, but they went to far and were wrong. Only the first patch is relevant here.
Comment 12 Bernardo Gonzalez Kriegel 2020-02-27 02:16:23 UTC
Created attachment 99681 [details] [review]
Bug 21746: Remove NO_LIBRARY_SET

NO_LIBRARY_SET was used when the DB user was logged in. Since bug 20489
it's not longer possible. We could remove the code.

One occurrence left in C4::InstallAuth as there is no (real) logged in user yet.

Test plan:
* Install Koha to make sure NO_LIBRARY_SET is not needed during the
install process
* Login into Koha
* Make sure the your library's name is displayed correctly in the header
* Set another library
* Confirm that the library's name is updated

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No problem during install, nor changing library.
Fixed (pre-existing) tab in circ/branchtransfers.pl
No errors
Comment 13 Katrin Fischer 2020-02-29 21:18:08 UTC
Created attachment 99833 [details] [review]
Bug 21746: Remove NO_LIBRARY_SET

NO_LIBRARY_SET was used when the DB user was logged in. Since bug 20489
it's not longer possible. We could remove the code.

One occurrence left in C4::InstallAuth as there is no (real) logged in user yet.

Test plan:
* Install Koha to make sure NO_LIBRARY_SET is not needed during the
install process
* Login into Koha
* Make sure the your library's name is displayed correctly in the header
* Set another library
* Confirm that the library's name is updated

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No problem during install, nor changing library.
Fixed (pre-existing) tab in circ/branchtransfers.pl
No errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Martin Renvoize 2020-03-02 10:43:02 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 15 Joy Nelson 2020-03-31 22:46:48 UTC
enhancement not backported to 19.11.x