Bug 26231: Remove incorrect use of AddAuthority() when 001 present
This patch removes the use of AddAuthority with a non-empty authid argument, since that triggers an update rather than an insert. In practice, the update also fails, but the error isn't raised, as the database connection doesn't have RaiseError set. Test plan: 1) Do not apply patch 2) Try to bulkmarcimport an authority file with a 001 3) Observe that the script reports success but no authority is added 4) Apply the path 5) Try to bulkmarcimport an authority file with a 001 6) Observe that the script reports success and the authority is added Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (cherry picked from commit9622561636) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit276602aadb) Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> (cherry picked from commitbe9eeef3c9) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
parent
28b8065003
commit
a2cbbb4e1d
|
|
@ -395,17 +395,6 @@ RECORD: while ( ) {
|
|||
printlog({id=>$originalid||$id||$authid, op=>"edit",status=>"ok"}) if ($logfile);
|
||||
}
|
||||
}
|
||||
elsif (defined $authid) {
|
||||
## An authid is defined but no authority in database : add
|
||||
eval { ( $authid ) = AddAuthority($record,$authid, $authtypecode) };
|
||||
if ($@){
|
||||
warn "Problem with authority $authid Cannot Add ".$@;
|
||||
printlog({id=>$originalid||$id||$authid, op=>"insert",status=>"ERROR"}) if ($logfile);
|
||||
}
|
||||
else{
|
||||
printlog({id=>$originalid||$id||$authid, op=>"insert",status=>"ok"}) if ($logfile);
|
||||
}
|
||||
}
|
||||
else {
|
||||
## True insert in database
|
||||
eval { ( $authid ) = AddAuthority($record,"", $authtypecode) };
|
||||
|
|
|
|||
Loading…
Reference in New Issue