[Bug 11084] New: Delete biblios on Leader 05 =d
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Bug ID: 11084 Summary: Delete biblios on Leader 05 =d Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: gmcharlt@gmail.com Reporter: drnoe@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Position 05 of the leader in MARC 21 indicates the record's status. A lower case “d” indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). Koha should allow for deletion of bibliographic records that contain a “d” in the LEADER position 05 when by overlaying existing records. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 22088 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=22088&action=edit Bug 11084 - Delete biblios on Leader 05 =d -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Assignee|gmcharlt@gmail.com |kyle@bywatersolutions.com Severity|enhancement |trivial -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #22088|0 |1 is obsolete| | --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 22089 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=22089&action=edit Bug 11084 - Delete biblios on Leader 05 =d Position 05 of the leader in MARC 21 indicates the record's status. A lower case “d” indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/deleted_fixed_field_5.pl -c -v 3) Those records should either be deleted, or an error message should state why the were not. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10421 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- See also - bug 10421 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 mathieu saby <mathieu.saby@univ-rennes2.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mathieu.saby@univ-rennes2.f | |r --- Comment #4 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- Note : the label for UNIMARC is buit the same way pos5 = "d" means deleted http://multimedia.bnf.fr/unimarcb_trad/Bsection5-Label_notice-6-2010.pdf So it could be made too for unimarc. Mathieu -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |brendan@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 David Noe <drnoe@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from David Noe <drnoe@bywatersolutions.com> --- Tool needs to be able to delete biblios with items (and the items). Also, it should be able to run in a test mode. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #22089|0 |1 is obsolete| | --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 22172 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=22172&action=edit Bug 11084 - Delete biblios on Leader 05 =d Position 05 of the leader in MARC 21 indicates the record's status. A lower case “d” indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/deleted_fixed_field_5.pl -c -v 3) Those records should either be deleted, or an error message should state why the were not. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 I'm just a bot <gitbot@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gitbot@bugs.koha-community. | |org When did the bot| |2013-10-30 last check this| | --- Comment #7 from I'm just a bot <gitbot@bugs.koha-community.org> --- Patch applied cleanly, go forth and signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle.m.hall@gmail.com --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- *** Bug 10421 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #22172|0 |1 is obsolete| | --- Comment #9 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 22634 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=22634&action=edit Bug 11084 - Delete biblios on Leader 05 == d Position 05 of the leader in MARC 21 indicates the record's status. A lower case 'd' indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/deleted_fixed_field_5.pl -c -v 3) Those records should either be deleted, or an error message should state why they were not. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Works as advertised. Put some points of attention on Bugzilla comment. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #10 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Signing off but with some smaller comments: typo delete_fixec_field_5.pl test mode should be explained (not in usage) name of the script could be confusing: you are obviously not deleting a fixed field, but a record :) encoding: when you are printing the title to stdout, you should probably open stdout as utf8 verbose mode: would it be helpful to say which biblios or items were actually deleted (and count them?) license statement: version 2 or 3? address no longer? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, a few notes from me too: DelBiblio has a few shortcomings that could cause problems: 1) It just deletes attached subscriptions. Subscription data can be created over a long time and is not easily reproducable. There is no backup when we delete it. 428 # We delete attached subscriptions 429 require C4::Serials; 430 my $subscriptions = C4::Serials::GetFullSubscriptionsFromBiblionumber($biblionumber); 431 foreach my $subscription (@$subscriptions) { 432 C4::Serials::DelSubscription( $subscription->{subscriptionid} ); 433 } 2) It will also delete records that are used with orders, as this isn't checked at all. Kyle, could you take a look at Marcel's and my comments? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, bit confused about the help too - is there a way to get it to list all available options? -h didn't seem to do the trick. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Amber Hunt <amber@marlboro.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amber@marlboro.edu -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Pablo AB <pablo.bianchi@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pablo.bianchi@gmail.com --- Comment #13 from Pablo AB <pablo.bianchi@gmail.com> --- (In reply to Kyle M Hall from comment #6)
Position 05 of the leader in MARC 21 indicates the record's status. A lower case “d” indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). JFTR, that link talks about authority records, but for biblio records is the same: http://www.loc.gov/marc/bibliographic/bdleader.html
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #22634|0 |1 is obsolete| | --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 36837 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36837&action=edit Bug 11084 - Delete biblios on Leader 05 == d Position 05 of the leader in MARC 21 indicates the record's status. A lower case 'd' indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/deleted_fixed_field_5.pl -c -v 3) Those records should either be deleted, or an error message should state why they were not. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Works as advertised. Put some points of attention on Bugzilla comment. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36837|0 |1 is obsolete| | --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 36838 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36838&action=edit Bug 11084 - Delete biblios on Leader 05 == d Position 05 of the leader in MARC 21 indicates the record's status. A lower case 'd' indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/delete_records_via_leader.pl -c -v 3) Those records should either be deleted, or an error message should state why they were not. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Works as advertised. Put some points of attention on Bugzilla comment. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36838|0 |1 is obsolete| | --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 36840 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36840&action=edit Bug 11084 - Delete biblios on Leader 05 == d Position 05 of the leader in MARC 21 indicates the record's status. A lower case 'd' indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/delete_records_via_leader.pl -c -v 3) Those records should either be deleted, or an error message should state why they were not. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Script now displays all options. (In reply to Katrin Fischer from comment #12)
Hm, bit confused about the help too - is there a way to get it to list all available options? -h didn't seem to do the trick.
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #18 from Kyle M Hall <kyle@bywatersolutions.com> --- Updated patch should address all these concerns. (In reply to M. de Rooy from comment #10)
Signing off but with some smaller comments:
typo delete_fixec_field_5.pl test mode should be explained (not in usage) name of the script could be confusing: you are obviously not deleting a fixed field, but a record :) encoding: when you are printing the title to stdout, you should probably open stdout as utf8 verbose mode: would it be helpful to say which biblios or items were actually deleted (and count them?) license statement: version 2 or 3? address no longer?
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- This is a definite issue, but appears to be outside the scope of this bug. It would appear that misc/batchdeletebiblios.pl has the exact same issues. I would suggest we file a separate bug to handle that issue. (In reply to Katrin Fischer from comment #11)
Hm, a few notes from me too:
DelBiblio has a few shortcomings that could cause problems:
1) It just deletes attached subscriptions. Subscription data can be created over a long time and is not easily reproducable. There is no backup when we delete it.
428 # We delete attached subscriptions 429 require C4::Serials; 430 my $subscriptions = C4::Serials::GetFullSubscriptionsFromBiblionumber($biblionumber); 431 foreach my $subscription (@$subscriptions) { 432 C4::Serials::DelSubscription( $subscription->{subscriptionid} ); 433 }
2) It will also delete records that are used with orders, as this isn't checked at all.
Kyle, could you take a look at Marcel's and my comments?
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Tom Misilo <misilot@fit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |misilot@fit.edu -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36840|0 |1 is obsolete| | --- Comment #20 from Magnus Enger <magnus@enger.priv.no> --- Created attachment 37714 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37714&action=edit Bug 11084 - Delete biblios on Leader 05 == d Position 05 of the leader in MARC 21 indicates the record's status. A lower case 'd' indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/delete_records_via_leader.pl -c -v 3) Those records should either be deleted, or an error message should state why they were not. Signed-off-by: Magnus Enger <magnus@enger.priv.no> Works as advertised. Edited a record with an item to have leader05 = d, then ran delete_records_via_leader.pl with -c and got a message that the record could not be deleted because of the item. Removed the item and the script deleted the record. Tried with another record with an item, this time with the -i option and the record was deleted. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA Severity|trivial |enhancement --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Kyle, I am ok with this missing checks for subscriptions and orders - I think we can assume here checks have been made when setting the flag (although i would like a 'save delete' option or something similar :) ) But can you please fix: FAIL misc/cronjobs/delete_records_via_leader.pl FAIL critic I/O layer ":utf8" used at line 24, column 1. Use ":encoding(UTF-8)" to get strict validation. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #22 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37954 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37954&action=edit Bug 11084 [QA Followup] -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #23 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Kyle, I did some tests with the new patches: Record has 1 item, is not checked out. -t -c ERROR DELETING BIBLIO 24: Test mode enabled I was not sure if this would have been an error outside the test mode (not being deleted) or if that just meant that it was not deleted because of the test mode. -t -i -c ERROR DELETING ITEM 102: Test mode enabled ERROR DELETING BIBLIO 24: Test mode enabled Ok, so both throw an error... so not sure: would those be deleted without -t? -c ERROR DELETING BIBLIO 24: This Biblio has items attached, please delete them first before deleting this biblio This one is good - why not display this in the test mode too? -c -i C4::Context->userenv not defined! at /home/katrin/kohaclone/C4/Items.pm line 2278. No messages, but I didn't set verbose. Item and record appear to have been deleted - can you take a look at the error/warn? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #24 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 38336 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38336&action=edit Bug 11084 [QA Followup] - Suppress userenv warning -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #25 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #23)
Hi Kyle,
I did some tests with the new patches:
Record has 1 item, is not checked out.
-t -c ERROR DELETING BIBLIO 24: Test mode enabled
I was not sure if this would have been an error outside the test mode (not being deleted) or if that just meant that it was not deleted because of the test mode.
Right now it's not possible to tell if a record is deletable in Koha without trying to delete it! There are simply no library functions to do so. The test mode will tell you what records and items it would attempt to delete, but is not meant to tell you if they would be deleted successfully.
-t -i -c ERROR DELETING ITEM 102: Test mode enabled ERROR DELETING BIBLIO 24: Test mode enabled
Ok, so both throw an error... so not sure: would those be deleted without -t?
See above.
-c ERROR DELETING BIBLIO 24: This Biblio has items attached, please delete them first before deleting this biblio
This one is good - why not display this in the test mode too?
See above as well ; ) The errors come from DelBiblio, so the only way to know if the record can't be deleted is to try to delete it!
-c -i C4::Context->userenv not defined! at /home/katrin/kohaclone/C4/Items.pm line 2278.
No messages, but I didn't set verbose. Item and record appear to have been deleted - can you take a look at the error/warn?
I've attached a followup to take care of this. userenv isn't defined for cli scripts, so we just need to check for it's existence before using it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #26 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Can we make that clear in the documentation for the test mode? that it will only list items that it would 'try' to delete? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #27 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 38337 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38337&action=edit Bug 11084 [QA Followup] - Document limitations of test mode -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #28 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38361 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38361&action=edit [PASSED QA] Bug 11084 - Delete biblios on Leader 05 == d Position 05 of the leader in MARC 21 indicates the record's status. A lower case 'd' indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/delete_records_via_leader.pl -c -v 3) Those records should either be deleted, or an error message should state why they were not. Signed-off-by: Magnus Enger <magnus@enger.priv.no> Works as advertised. Edited a record with an item to have leader05 = d, then ran delete_records_via_leader.pl with -c and got a message that the record could not be deleted because of the item. Removed the item and the script deleted the record. Tried with another record with an item, this time with the -i option and the record was deleted. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #29 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38362 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38362&action=edit [PASSED QA] Bug 11084 [QA Followup] Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #30 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38363 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38363&action=edit [PASSED QA] Bug 11084 [QA Followup] - Suppress userenv warning Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #31 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38364 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38364&action=edit [PASSED QA] Bug 11084 [QA Followup] - Document limitations of test mode Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38336|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38337|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37714|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37954|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nicole@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Heather Braum <hbraum@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hbraum@nekls.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Suzanne Fayle <sfayle@roseman.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sfayle@roseman.edu -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38361|0 |1 is obsolete| | --- Comment #32 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 46021 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46021&action=edit Bug 11084 - Delete biblios on Leader 05 == d Position 05 of the leader in MARC 21 indicates the record's status. A lower case 'd' indicates that the record is to be deleted (http://www.loc.gov/marc/authority/adleader.html). This patch adds a cronjob script that may be run nightly to delete records where position 05 of the leader is set to 'd'. Test Plan: 1) Edit one or more records, and set the leader position 05 to 'd'. 2) Run misc/cronjobs/delete_records_via_leader.pl -c -v 3) Those records should either be deleted, or an error message should state why they were not. Signed-off-by: Magnus Enger <magnus@enger.priv.no> Works as advertised. Edited a record with an item to have leader05 = d, then ran delete_records_via_leader.pl with -c and got a message that the record could not be deleted because of the item. Removed the item and the script deleted the record. Tried with another record with an item, this time with the -i option and the record was deleted. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38362|0 |1 is obsolete| | --- Comment #33 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 46022 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46022&action=edit Bug 11084 [QA Followup] Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38363|0 |1 is obsolete| | --- Comment #34 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 46023 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46023&action=edit Bug 11084 [QA Followup] - Suppress userenv warning Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38364|0 |1 is obsolete| | --- Comment #35 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 46024 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46024&action=edit Bug 11084 [QA Followup] - Document limitations of test mode Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #36 from Brendan Gallagher <brendan@bywatersolutions.com> --- Pushed to master - Thanks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #37 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 46021 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46021 Bug 11084 - Delete biblios on Leader 05 == d Review of attachment 46021: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=11084&attachment=46021) ----------------------------------------------------------------- ::: misc/cronjobs/delete_records_via_leader.pl @@ +67,5 @@
+} + +my $schema = Koha::Database->new()->schema(); +my @biblioitems = + $schema->resultset('Biblioitem')->search( { marc => { LIKE => '_____d%' } } );
We're reading the 'marc' field as a string? While that's pretty fast on smaller databases, it takes about 60 seconds on a database with about 1.1 million bib records. I suppose performance doesn't matter too much for a cronjob though - depending on the frequency that it's run. Also, aren't we trying to get rid of the biblioitems.marc field? See: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10455 Wouldn't it be better if we started indexing LDR05 as 'rstatus' or "record_status' or some such? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #38 from David Cook <dcook@prosentient.com.au> --- More over, if we indexed LDR05, we would be able to hide "deleted" records from the OPAC like we do with "suppressed" records. While we had to worry about that OpacSuppression bug, which erroneously returned 0 results when the OpacSuppression index was completely empty, we don't need to worry about that too much since we started using @attr 14=1 http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15198. We could prepend @attr 14=1 at the start of all queries (so that it applied to all query parts) and we wouldn't encounter that problem anymore. -- I desire the above behaviour also because of what David Noe originally described here. It would be nice if records with a LDR05 "d" were deleted during the overlay of existing records during an import. In my case, I'm downloading records via OAI-PMH, but when I get a record with a "deleted" status, I'm not given a metadata record. I just have an identifier and a deleted status. So I can create an empty MARC record, change LDR05 to "d", inject the identifier, and then match to existing records in Koha. However, I don't want to overlay an empty record over a non-empty record in Koha, and then have it show up in search results in the OPAC. Actually, I wouldn't want it to show up in search results in the staff client either, but that might be unavoidable... I suppose I could also add a fake title to the record like "This record has been deleted" or some such, although that's not translation friendly... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=15537 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11084 --- Comment #39 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 46021 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46021 Bug 11084 - Delete biblios on Leader 05 == d Review of attachment 46021: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=11084&attachment=46021) ----------------------------------------------------------------- ::: misc/cronjobs/delete_records_via_leader.pl @@ +67,5 @@
+} + +my $schema = Koha::Database->new()->schema(); +my @biblioitems = + $schema->resultset('Biblioitem')->search( { marc => { LIKE => '_____d%' } } );
Once Bug 15537 (http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15537) is pushed, this could be replaced with the following query with C4::Search::SimpleSearch(): "Record-status=d" -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org