[Bug 18284] New: Biblio metadata are not moved to the deleted table when a biblio is deleted
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Bug ID: 18284 Summary: Biblio metadata are not moved to the deleted table when a biblio is deleted Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: blocker Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org There is a deletedbiblio_metadata table but it is not populated when a biblio is deleted. Since we have a ON DELETE constraint on biblio_metadata.biblionumber, the row is deleted when the biblio entry is deleted => data lost! We absolutely need this one before the next release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |17196 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17196 [Bug 17196] Move marcxml out of the biblioitems table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 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=18284 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 61184 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61184&action=edit Bug 18284: (bug 17196 follow-up) Move biblio metadata when a biblio is deleted There is a deletedbiblio_metadata table but it is not populated when a biblio is deleted. Since we have a ON DELETE constraint on biblio_metadata.biblionumber, the row is deleted when the biblio entry is deleted => data lost! Test plan: - Create a biblio - Delete it => Without this patch the deletedbiblio_metadata table is not populated with the biblio_metadata row related to the biblio => With this patch applied you should see that the row has been moved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61184|0 |1 is obsolete| | --- Comment #2 from Marc Véron <veron@veron.ch> --- Created attachment 61193 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61193&action=edit Bug 18284: (bug 17196 follow-up) Move biblio metadata when a biblio is deleted There is a deletedbiblio_metadata table but it is not populated when a biblio is deleted. Since we have a ON DELETE constraint on biblio_metadata.biblionumber, the row is deleted when the biblio entry is deleted => data lost! Test plan: - Create a biblio - Delete it => Without this patch the deletedbiblio_metadata table is not populated with the biblio_metadata row related to the biblio => With this patch applied you should see that the row has been moved. Followed test plan, behaves as expected Signed-off-by: Marc Véron <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I wish we flagged deleted rather than had deleted_* tables.. this sort of thing would be far less fraught with dangers that way. I would also do this at the DBIC level personally.. with a monkeypatch of the standard delete call. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Comment on attachment 61193 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61193 Bug 18284: (bug 17196 follow-up) Move biblio metadata when a biblio is deleted Review of attachment 61193: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=18284&attachment=61193) ----------------------------------------------------------------- New FIXME..? ::: C4/Biblio.pm @@ +3361,4 @@
my $sth = $dbh->prepare("SELECT * FROM biblio WHERE biblionumber=?"); $sth->execute($biblionumber);
+ # FIXME There is a transaction in _koha_delete_biblio_metadata
Why add the FIXME rather than adding the code to actually solve the problem? Nested transactions work well in DBIC whenever I've used them -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- OK, I can see why it's not at the DBIC level.. C4 module not Koha.. my bad. :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olli-antti.kivilahti@jns.fi --- Comment #6 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- (In reply to Martin Renvoize from comment #3)
I wish we flagged deleted rather than had deleted_* tables.. this sort of thing would be far less fraught with dangers that way.
I would also do this at the DBIC level personally.. with a monkeypatch of the standard delete call.
I kinda agree. Having two separate tables makes doing reports very very awkward. But I guess there would be a performance penalty of having 5 years of history in the biblioitems-table eh? After over two and a half years of service, our DB has 153569 deletedbiblio- and 1422962 biblio-rows. deletebiblio has no effect performance-wise. Martin I am 100% with you on this topic. Martin. Take a look at Bug 18265 and comment on what these cultural Marxists are about to do. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18265 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Olli-Antti Kivilahti from comment #6)
comment on what these cultural Marxists are about to do.
Hmm Quote: "about 99.9% of the time "Cultural Marxism" is a snarl word used to attack anyone with progressive tendencies" Link with Nazi Germany? imo we could do without such terms? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61193|0 |1 is obsolete| | --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61208 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61208&action=edit Bug 18284: (bug 17196 follow-up) Move biblio metadata when a biblio is deleted There is a deletedbiblio_metadata table but it is not populated when a biblio is deleted. Since we have a ON DELETE constraint on biblio_metadata.biblionumber, the row is deleted when the biblio entry is deleted => data lost! Test plan: - Create a biblio - Delete it => Without this patch the deletedbiblio_metadata table is not populated with the biblio_metadata row related to the biblio => With this patch applied you should see that the row has been moved. Followed test plan, behaves as expected Signed-off-by: Marc Véron <veron@veron.ch> 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=18284 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18284 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61209 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61209&action=edit Bug 18284: [QA Follow-up] Add test descriptions 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=18284 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Martin Renvoize from comment #4)
Why add the FIXME rather than adding the code to actually solve the problem?
Passed QA since we need the deleted xml. But I agree that the FIXME and the transaction stuff needs further attention. The result of the new txn_do call is not even checked. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Martin Renvoize from comment #3)
I wish we flagged deleted rather than had deleted_* tables.. this sort of thing would be far less fraught with dangers that way.
I am just following the existing pattern, used twice already. Moreover the table already exists and we want to keep FK. Without 2 differents we could not keep the FK.
I would also do this at the DBIC level personally.. with a monkeypatch of the standard delete call.
With a critical or blocker I always try to provide as small fix as possible to avoid any integration problems. Without using DBIx::Class I avoid creating 2 new packages + provide tests (~100 lines minimum). (In reply to Martin Renvoize from comment #4)
Comment on attachment 61193 [details] [review] New FIXME..?
Yes? What's wrong with FIXME? I provide code that is not good, I highlight it in the codebase.
::: C4/Biblio.pm @@ +3361,4 @@
my $sth = $dbh->prepare("SELECT * FROM biblio WHERE biblionumber=?"); $sth->execute($biblionumber);
+ # FIXME There is a transaction in _koha_delete_biblio_metadata
Why add the FIXME rather than adding the code to actually solve the problem?
Nested transactions work well in DBIC whenever I've used them
Yes of course, I use them in these tests and they pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm happy with this.. just thought the FIXME worth pointing out. I'm hoping there's an intention to go back and fix the fixme 'tis all ;) Is there a broader discussion anywhere regarding delete_* tables.. that was more a throw away comment to be honest. I was tempted to pass qa on it myself but hadn't yet fully tested it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Martin Renvoize from comment #12)
I'm happy with this.. just thought the FIXME worth pointing out. I'm hoping there's an intention to go back and fix the fixme 'tis all ;)
Is there a broader discussion anywhere regarding delete_* tables.. that was more a throw away comment to be honest. I was tempted to pass qa on it myself but hadn't yet fully tested it.
Yes, and especially the last 2 months as we faced critical issues, like bug 18242 for instance, or bug 18003. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brendan@bywatersolutions.co | |m Status|Passed QA |Pushed to Master --- Comment #14 from Brendan Gallagher <brendan@bywatersolutions.com> --- Pushed to Master - Should be in the May 17.05 Release. Thanks much! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18284 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |katrin.fischer@bsz-bw.de Status|Pushed to Master |RESOLVED --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Depends on bug 17196 which is not in 16.11.x - not needed there. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org