[Bug 31784] New: SingleBranchMode ignores public flag
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Bug ID: 31784 Summary: SingleBranchMode ignores public flag Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org The test in C4/Auth.pm: singleBranchMode => ( Koha::Libraries->search->count == 1 ), misses a fundamental condition, i.e. public should be true. C4/XSLT.pm: my $singleBranchMode = Koha::Libraries->search->count == 1 ? 1 : 0; t/Koha.t: is ( Koha::Libraries->search->count, 1, 'There should be only 1 library (singleBranchMode on)' ); -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 141855 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141855&action=edit Bug 31784: Add Libraries->singleBranchMode Test plan: Run t/db_dependent/Koha/Libraries.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 141856 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141856&action=edit Bug 31784: Replace some singleBranchMode occurrences Speaks for itself. Test plan: Run t/Koha.t. Check if OPAC shows Library or Libraries in masthead, depending on number of public branches. Login, place a hold. Verify things work as expected. Note: MARC21 XSLT does not care about singleBranchMode. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- snake case: single_library_mode? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #3)
snake case: single_library_mode?
Do we prefer that now? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Coding guidelines mention snakecase for subroutines ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- LoginFirstname => ( C4::Context->userenv ? C4::Context->userenv->{"firstname"} : "Bel" ), LoginSurname => C4::Context->userenv ? C4::Context->userenv->{"surname"} : "Inconnu", emailaddress => C4::Context->userenv ? C4::Context->userenv->{"emailaddress"} : undef, TagsEnabled => C4::Context->preference("TagsEnabled"), hide_marc => C4::Context->preference("hide_marc"), item_level_itypes => C4::Context->preference('item-level_itypes'), patronimages => C4::Context->preference("patronimages"), singleBranchMode => $singleLibraryMode, #TODO one day our templates will only contain Library, and this can be removed singleLibraryMode => $singleLibraryMode, noItemTypeImages => C4::Context->preference("noItemTypeImages"), marcflavour => C4::Context->preference("marcflavour"), OPACBaseURL => C4::Context->preference('OPACBaseURL'), minPasswordLength => $minPasswordLength, Some work to do :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31775 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141855|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 141857 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141857&action=edit Bug 31784: Add Libraries->singleBranchMode Test plan: Run t/db_dependent/Koha/Libraries.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141856|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 141858 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141858&action=edit Bug 31784: Replace some singleBranchMode occurrences Speaks for itself. Test plan: Run t/Koha.t. Check if OPAC shows Library or Libraries in masthead, depending on number of public branches. Login, place a hold. Verify things work as expected. Note: MARC21 XSLT does not care about singleBranchMode. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #5)
Coding guidelines mention snakecase for subroutines ;)
Het kwartje is gevallen :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 141870 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141870&action=edit Bug 31784: (QA follow-up) Snake case for subroutine singleLibraryMode => single_library_mode Test plan: Run t/db_dependent/Koha/Libraries.t Run qa tools. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |31816 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31816 [Bug 31816] Switch singleBranchMode to singleLibraryMode -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It looks like there is still some code in Koha.pm/Search.pm using Koha::Libraries->search->count == 1 to decide about displaying library facets. But since the routine is the same for staff and OPAC a bigger change would be needed. I've filed bug 31816 to switch singleBranchMode to singleLibraryMode everywhere. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141857|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 141927 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141927&action=edit Bug 31784: Add Libraries->singleBranchMode Test plan: Run t/db_dependent/Koha/Libraries.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141858|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 141928 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141928&action=edit Bug 31784: Replace some singleBranchMode occurrences Speaks for itself. Test plan: Run t/Koha.t. Check if OPAC shows Library or Libraries in masthead, depending on number of public branches. Login, place a hold. Verify things work as expected. Note: MARC21 XSLT does not care about singleBranchMode. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141870|0 |1 is obsolete| | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 141929 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141929&action=edit Bug 31784: (QA follow-up) Snake case for subroutine singleLibraryMode => single_library_mode Test plan: Run t/db_dependent/Koha/Libraries.t Run qa tools. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |31817 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31817 [Bug 31817] Libraries navigation item should not display if all libaries are set to non-public -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141928|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141929|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141927|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 141969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141969&action=edit Bug 31784: Add Libraries->singleBranchMode Test plan: Run t/db_dependent/Koha/Libraries.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 141970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141970&action=edit Bug 31784: Replace some singleBranchMode occurrences Speaks for itself. Test plan: Run t/Koha.t. Check if OPAC shows Library or Libraries in masthead, depending on number of public branches. Login, place a hold. Verify things work as expected. Note: MARC21 XSLT does not care about singleBranchMode. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 141971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141971&action=edit Bug 31784: (QA follow-up) Cleanup This patch makes use of a ternary operator to simplify the code, and removes references to renamed things. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Hi, I like what we are approaching here. But I don't think ->single_branch_mode is a Koha::Libraries (resultset) method. I.e. you're using it in Koha::Libraries->new->single_branch_mode, but devs could mistakenly use it on already calculated resultsets... If it wasn't ugly, I'd just say this should be a C4::Context method. I'm sorry to fail it, but don't have the bandwidth to think of an alternative placement right now. Happy to help if you follow-up on this. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #19 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Ternary is fine, Tomas. - Aka singleBranchMode. -sub single_library_mode { # formerly called singleBranchMode Removing those I would not do yet, while we still have lots of old occurrences. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Looking at this again today... I also wonder if we are not overstretching the meaning of the public flag. At the moment on the form it appears with the hint: Set to 'yes' to show this library on the Libraries page in the OPAC. Libraries might have a reason to not want a library show in the list (it could be stacks, they don't the address to show), but it should still show up in facets, on the detail pages, etc. We might need to differentiate more. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #21 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #20)
Looking at this again today... I also wonder if we are not overstretching the meaning of the public flag. At the moment on the form it appears with the hint:
Set to 'yes' to show this library on the Libraries page in the OPAC.
Libraries might have a reason to not want a library show in the list (it could be stacks, they don't the address to show), but it should still show up in facets, on the detail pages, etc.
We might need to differentiate more.
Sounds reasonable :) Main thing here is actually getting this test a bit more consolidated. Some features are added in a very narrow scope but end up geting used much wider, with all benefits and disadvantages coming for free. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Marcel de Rooy from comment #21)
(In reply to Katrin Fischer from comment #20)
Looking at this again today... I also wonder if we are not overstretching the meaning of the public flag. At the moment on the form it appears with the hint:
Set to 'yes' to show this library on the Libraries page in the OPAC.
Libraries might have a reason to not want a library show in the list (it could be stacks, they don't the address to show), but it should still show up in facets, on the detail pages, etc.
We might need to differentiate more.
Sounds reasonable :) Main thing here is actually getting this test a bit more consolidated. Some features are added in a very narrow scope but end up geting used much wider, with all benefits and disadvantages coming for free.
I am not too keen on undocumented features, got way too many of those. At least leaving a trace outside of the code is necessary. At the moment we have a setting for the libraries page, a setting for pickup-locations and there is one about the library pull downs in search too: Bug 31654 - Hide non-public libraries from MastheadLibraryPulldown It might be worth checking the effects of SingleLibraryMode over to decide. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31784 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |RESOLVED Resolution|--- |WONTFIX --- Comment #23 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- I am abandoning this development. This will be consuming too much time. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org