I'm trying to import authorities which already have a 001 and bulkmarcimport.pl says that it's worked but it hasn't actually imported anything and no errors have been thrown. I'm using this command: koha-shell -c "perl /usr/share/koha/bin/migration_tools/bulkmarcimport.pl -file /home/dcook/auth.mrc -a -fk -d -v -l /tmp/auth.log" <instance> It appears to be because the value from the 001 is being passed to AddAuthority() which - instead of adding the authority - is trying to update an existing authority.
Created attachment 108431 [details] [review] 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
Looks logical. Maybe just log that value of 001 will be lost no ?
(In reply to Fridolin SOMERS from comment #2) > Looks logical. > Maybe just log that value of 001 will be lost no ? Possibly although that's already the case now?
I think Bug 12722 - bulkmarcimport.pl: Should we move the old 001 to 035 would deal with the issue of the lost 001. I am adding Marcel here, if I IIRC this is related to work he did a while ago. (Bug 18014)
Created attachment 110448 [details] [review] 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>
Created attachment 110761 [details] [review] 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>
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.05
backported to 19.11.x for 19.11.11
Backported to 19.05.x branch for 19.05.16