bug 5783: follow-up - fix logging of modifications
authorGalen Charlton <gmcharlt@gmail.com>
Thu, 3 Mar 2011 21:54:01 +0000 (16:54 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 7 Mar 2011 02:04:20 +0000 (15:04 +1300)
Fix so that modifying an authority record is not logged
as both an ADD and a MODIFY.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/AuthoritiesMarc.pm

index 5d1378c..f3cc948 100644 (file)
@@ -701,8 +701,8 @@ sub AddAuthority {
     my $sth=$dbh->prepare("insert into auth_header (authid,datecreated,authtypecode,marc,marcxml) values (?,now(),?,?,?)");
     $sth->execute($authid,$authtypecode,$record->as_usmarc,$record->as_xml_record($format));
     $sth->finish;
+    logaction( "AUTHORITIES", "ADD", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog");
   }
-  logaction( "AUTHORITIES", "ADD", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog");
   ModZebra($authid,'specialUpdate',"authorityserver",$oldRecord,$record);
   return ($authid);
 }