Bugzilla – Attachment 6163 Details for
Bug 7146
Update timestamps when deleting a biblio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch.txt (text/plain), 3.34 KB, created by
Marcel de Rooy
on 2011-11-03 12:59:45 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2011-11-03 12:59:45 UTC
Size:
3.34 KB
patch
obsolete
>From a3eab245e05cf5ced5b152c4069e8f0093148c5e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 3 Nov 2011 13:41:24 +0100 >Subject: [PATCH] 7146 (Update timestamps when deleting a biblio) >Content-Type: text/plain; charset="utf-8" > >Currently, when you delete an item, the timestamp column in deleteditems is >updated with current time. (This comes from an [unintentional] additional >update statement in DelItem.) It makes deletion time visible. >In the past, the marcxml was updated too at that moment, resulting in an >updated timestamp in biblioitems too. The timestamp in biblio was not touched. > >If you delete a biblio however, the timestamps in deletedbiblio and >deletedbiblioitems do not reflect time of deletion. They still show the time of >last update before the record was deleted. This last update can be extracted >from MARC field 005 too. > >This behavior is not consistent nor logical. I would suggest to add a statement >in DelBiblio to force updating the timestamp in deletedbiblio(items) too. It >makes the time of deletion visible in the record too. The time of deletion of a >biblio can be very useful for e.g. synchronizing purposes. >--- > C4/Biblio.pm | 18 ++++++++++++------ > C4/Items.pm | 1 + > 2 files changed, 13 insertions(+), 6 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 4a9735f..8747cc5 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -3522,9 +3522,12 @@ sub _koha_delete_biblio { > $bkup_sth->finish; > > # delete the biblio >- my $del_sth = $dbh->prepare("DELETE FROM biblio WHERE biblionumber=?"); >- $del_sth->execute($biblionumber); >- $del_sth->finish; >+ my $sth2 = $dbh->prepare("DELETE FROM biblio WHERE biblionumber=?"); >+ $sth2->execute($biblionumber); >+ # update the timestamp (Bugzilla 7146) >+ $sth2= $dbh->prepare("UPDATE deletedbiblio SET timestamp=NOW() WHERE biblionumber=?"); >+ $sth2->execute($biblionumber); >+ $sth2->finish; > } > $sth->finish; > return undef; >@@ -3568,9 +3571,12 @@ sub _koha_delete_biblioitems { > $bkup_sth->finish; > > # delete the biblioitem >- my $del_sth = $dbh->prepare("DELETE FROM biblioitems WHERE biblioitemnumber=?"); >- $del_sth->execute($biblioitemnumber); >- $del_sth->finish; >+ my $sth2 = $dbh->prepare("DELETE FROM biblioitems WHERE biblioitemnumber=?"); >+ $sth2->execute($biblioitemnumber); >+ # update the timestamp (Bugzilla 7146) >+ $sth2= $dbh->prepare("UPDATE deletedbiblioitems SET timestamp=NOW() WHERE biblioitemnumber=?"); >+ $sth2->execute($biblioitemnumber); >+ $sth2->finish; > } > $sth->finish; > return undef; >diff --git a/C4/Items.pm b/C4/Items.pm >index 4915884..79a927c 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -587,6 +587,7 @@ sub DelItem { > # backup the record > my $copy2deleted = $dbh->prepare("UPDATE deleteditems SET marc=? WHERE itemnumber=?"); > $copy2deleted->execute( $record->as_usmarc(), $itemnumber ); >+ # This last update statement makes that the timestamp column in deleteditems is updated too. If you remove these lines, please add a line to update the timestamp separately. See Bugzilla report 7146 and Biblio.pm (DelBiblio). > > #search item field code > logaction("CATALOGUING", "DELETE", $itemnumber, "item") if C4::Context->preference("CataloguingLog"); >-- >1.6.0.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7146
:
6163
|
6181