[Bug 36873] New: Koha::Objects->delete should accept parameters and pass them through
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Bug ID: 36873 Summary: Koha::Objects->delete should accept parameters and pass them through Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Taking `Koha::Item->delete` as an example, it accepts many parameters. Calling `Koha::Items->delete` will find out there's a `delete()` method defined in `Koha::Item` and loop through all items, calling that particular method. It would be handy if we could pass on some parameters. As an example, the following sequence: ```perl $biblio->items->delete; DelBiblio( $biblio->id); ``` would trigger reindexing the record for each item, and then when actually deleting the biblio. With the current codebase, to avoid it, we could instead do: ```perl foreach my $item ($biblio->items->as_list) { $item->delete( { skip_record_index } ); } DelBiblio( $biblio->id); ``` But it would be great if we could just write: ```perl $biblio->items->delete( { skip_record_index => 1 } ); DelBiblio( $biblio->id ); ``` -- 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=36873 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 166790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166790&action=edit Bug 36873: Unit tests 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=36873 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 166791 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166791&action=edit Bug 36873: Make Koha::Objects->delete pass parameters to the underlying method This patch makes the generic method pass any parameters it got passed to the underlying `delete()` method. To test: 1. Apply the unit tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Objects.t => FAIL: Tests fail, parameters are not passed 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D 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=36873 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=36873 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166790|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 166799 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166799&action=edit Bug 36873: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=36873 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166791|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 166800 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166800&action=edit Bug 36873: Make Koha::Objects->delete pass parameters to the underlying method This patch makes the generic method pass any parameters it got passed to the underlying `delete()` method. To test: 1. Apply the unit tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Objects.t => FAIL: Tests fail, parameters are not passed 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=36873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166799|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168246 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168246&action=edit Bug 36873: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166800|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168247 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168247&action=edit Bug 36873: Make Koha::Objects->delete pass parameters to the underlying method This patch makes the generic method pass any parameters it got passed to the underlying `delete()` method. To test: 1. Apply the unit tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Objects.t => FAIL: Tests fail, parameters are not passed 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Martin Renvoize <martin.renvoize@ptfs-europe.com> 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=36873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Trivial bugfix, all working. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I thought this might be a good candidate for the failing test: https://jenkins.koha-community.org/job/Koha_Main/2954/testReport/junit/(root... not ok 1 - Fun with KitchenSink, Handler->delete ... but again it's passing for me locally. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #9)
I thought this might be a good candidate for the failing test:
https://jenkins.koha-community.org/job/Koha_Main/2954/testReport/junit/ (root)/t_db_dependent_Koha_Plugins_KitchenSink_t/ Fun_with_KitchenSink__Handler__delete__2283_/
not ok 1 - Fun with KitchenSink, Handler->delete
... but again it's passing for me locally.
There are other factors there. Looking shortly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #9)
I thought this might be a good candidate for the failing test:
https://jenkins.koha-community.org/job/Koha_Main/2954/testReport/junit/ (root)/t_db_dependent_Koha_Plugins_KitchenSink_t/ Fun_with_KitchenSink__Handler__delete__2283_/
not ok 1 - Fun with KitchenSink, Handler->delete
... but again it's passing for me locally.
I haven't found any relationship with this bug, unfortunately. What I was looking for were cases of ->delete being called with some parameter, and there aren't for plugin code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Tomás Cohen Arazi from comment #12)
(In reply to Katrin Fischer from comment #9)
I thought this might be a good candidate for the failing test:
https://jenkins.koha-community.org/job/Koha_Main/2954/testReport/junit/ (root)/t_db_dependent_Koha_Plugins_KitchenSink_t/ Fun_with_KitchenSink__Handler__delete__2283_/
not ok 1 - Fun with KitchenSink, Handler->delete
... but again it's passing for me locally.
I haven't found any relationship with this bug, unfortunately. What I was looking for were cases of ->delete being called with some parameter, and there aren't for plugin code.
It looks like it might have been a random one too. Let's see if ti appears again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 --- Comment #14 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #12)
(In reply to Katrin Fischer from comment #9)
I thought this might be a good candidate for the failing test:
https://jenkins.koha-community.org/job/Koha_Main/2954/testReport/junit/ (root)/t_db_dependent_Koha_Plugins_KitchenSink_t/ Fun_with_KitchenSink__Handler__delete__2283_/
not ok 1 - Fun with KitchenSink, Handler->delete
... but again it's passing for me locally.
I haven't found any relationship with this bug, unfortunately. What I was looking for were cases of ->delete being called with some parameter, and there aren't for plugin code.
The error was: koha_1 | Could not unlink /tmp/LSL387s/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm.pm: No such file or directory at /kohadevbox/koha/Koha/Plugins/Handler.pm line 110. koha_1 | koha_1 | # Failed test 'Module file no longer found' koha_1 | # at t/db_dependent/Koha/Plugins/KitchenSink.t line 68. koha_1 | # Looks like you failed 1 test of 7. koha_1 | koha_1 | # Failed test 'Fun with KitchenSink, Handler->delete' koha_1 | # at t/db_dependent/Koha/Plugins/KitchenSink.t line 74. koha_1 | # Looks like you failed 1 test of 1. koha_1 | [17:50:24] t/db_dependent/Koha/Plugins/KitchenSink.t ................................... koha_1 | Dubious, test returned 1 (wstat 256, 0x100) Which is bug 21670. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable CC| |lucas@bywatersolutions.com Version(s)|24.11.00 |24.11.00,24.05.06 released in| | --- Comment #15 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|24.11.00,24.05.06 |24.11.00,24.05.06,23.11.11 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #17 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36873 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED CC| |david@davidnind.com --- Comment #18 from David Nind <david@davidnind.com> --- Developer focused, no user interface changes, not covered in the manual - no update required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org