[Bug 16015] New: Cannot delete a group of libraries
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Bug ID: 16015 Summary: Cannot delete a group of libraries Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: System Administration Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Depends on: 15294 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15294 [Bug 15294] Move the C4::Branch related code to Koha::Libraries - part 1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 48852 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48852&action=edit Bug 16015: Restore the ability to delete a group of libraries If a group of libraries is linked to at least 1 library, the group cannot be delete and the librarian should get a warning message. But if no libraries are linked, the deletion should be allowed. Since bug 15294 this behavior is broken: The deletion is always blocked: "This library category cannot be deleted. 0 libraries are still using it", hum... Test plan: Create a group of libraries, delete it -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=15995 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |srdjan@catalyst.net.nz --- Comment #2 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- This is totally weird. It must be that $libraries_count gets interpreted as "0". Perl, I did not expect that from you. Anyway, although this patch does solve the issue, pedantic devil in me says - wait. The way it is written says my $libraries_count = (scalar( $category->libraries ) > 0) which does yield correct boolean, but evaluates to 1 no matter how many libraries are there. Correct way could be my $libraries_count = scalar( $category->libraries ) + 0 or (my $libraries_count = scalar( $category->libraries )) > 0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Srdjan Jankovic from comment #2)
This is totally weird. It must be that $libraries_count gets interpreted as "0". Perl, I did not expect that from you. Anyway, although this patch does solve the issue, pedantic devil in me says - wait. The way it is written says my $libraries_count = (scalar( $category->libraries ) > 0) which does yield correct boolean, but evaluates to 1 no matter how many libraries are there. Correct way could be my $libraries_count = scalar( $category->libraries ) + 0 or (my $libraries_count = scalar( $category->libraries )) > 0
Do not worry, what you read is confusing :) $category->libraries returns, in an array context, an array of DBIx::Class objects. But, in a scalar context, an ... iterator. So it's always defined. I will submit a patch to clarify the changes and avoid any confusions later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48852|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 48990 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48990&action=edit Bug 16015: Restore the ability to delete a group of libraries If a group of libraries is linked to at least 1 library, the group cannot be delete and the librarian should get a warning message. But if no libraries are linked, the deletion should be allowed. Since bug 15294 this behavior is broken: The deletion is always blocked: "This library category cannot be deleted. 0 libraries are still using it", hum... Test plan: Create a group of libraries, delete it -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- + if ( my $libraries_count = $category->libraries->count ) { is definitely the way to do :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Srdjan Jankovic <srdjan@catalyst.net.nz> 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=16015 --- Comment #6 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 49079 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49079&action=edit [SIGNED-OFF] Bug 16015: Restore the ability to delete a group of libraries If a group of libraries is linked to at least 1 library, the group cannot be delete and the librarian should get a warning message. But if no libraries are linked, the deletion should be allowed. Since bug 15294 this behavior is broken: The deletion is always blocked: "This library category cannot be deleted. 0 libraries are still using it", hum... Test plan: Create a group of libraries, delete it Signed-off-by: Srdjan <srdjan@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #48990|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=16015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 16091 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Raising the severity as it's a regression. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=16092 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- The patch fixes the problem, but the error/message dialogs are not looking quite right (maybe something for Owen/Aleisha :) ) Are you sure you want to delete the group '' (TEST)? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=16015 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #49079|0 |1 is obsolete| | --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 49331 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=49331&action=edit [PASSED QA] Bug 16015: Restore the ability to delete a group of libraries If a group of libraries is linked to at least 1 library, the group cannot be delete and the librarian should get a warning message. But if no libraries are linked, the deletion should be allowed. Since bug 15294 this behavior is broken: The deletion is always blocked: "This library category cannot be deleted. 0 libraries are still using it", hum... Test plan: Create a group of libraries, delete it Signed-off-by: Srdjan <srdjan@catalyst.net.nz> 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=16015 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=16047 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brendan@bywatersolutions.co | |m Status|Passed QA |Pushed to Master --- Comment #11 from Brendan Gallagher <brendan@bywatersolutions.com> --- Pushed to Master - Should be in the May 2016 release. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED CC| |julian.maurice@biblibre.com Resolution|--- |FIXED --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- Does not concern stable versions, status changed to RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org