Marcel de Rooy
48aba1533c
If we import items that have a wrong branch code, the items will not be imported but manage-marc-import reports them as imported. (A wrong branch code probably occurs most, but other causes are possible too.) The underlying cause is that AddItem does not look at the error returned from _koha_new_item in Items.pm. This patch deals with that omission in the most economical way. It adjusts AddItem so that it returns undef if no item was added. In ImportBatch.pm I check if an item was added and adjust the totals accordingly instead of just always counting them. Note: Several scripts like additem.pl use AddItemFromMarc to call AddItem. They do not report an error, but fail silently. With this patch, these scripts get undef and will still fail silently. (No change.) Adding error checks around calls of AddItemFromMarc is outside the scope of this report. Here we are taking care of correct imported item numbers. Test plan: [1] Verify that additem.pl still works by adding a new item. [2] Run t/db_dependent/Items.t [3] Add a new branchcode, say XXX. [4] Pick a biblio record with a few items (n) and set one item to branch XXX. [5] Export this biblio with items to a MARC file. [6] Change the XXX item to the original branch and remove branch XXX. [7] Import the MARC file. Verify that one item was not imported and that the number of imported items reflects that (equals n-1). Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> |
||
---|---|---|
.. | ||
AuthoritiesMarc | ||
Barcodes | ||
Bookseller | ||
ClassSortRoutine | ||
Creators | ||
External | ||
Form | ||
Heading | ||
ILSDI | ||
Installer | ||
Labels | ||
Linker | ||
Members | ||
OAI | ||
Output | ||
Patroncards | ||
Reports | ||
Search | ||
Serials | ||
SIP | ||
Utils | ||
Accounts.pm | ||
Acquisition.pm | ||
Auth.pm | ||
Auth_cas_servers.yaml.sample | ||
Auth_with_cas.pm | ||
Auth_with_ldap.pm | ||
Auth_with_shibboleth.pm | ||
AuthoritiesMarc.pm | ||
BackgroundJob.pm | ||
Barcodes.pm | ||
Biblio.pm | ||
Bookseller.pm | ||
Boolean.pm | ||
Breeding.pm | ||
Budgets.pm | ||
Calendar.pm | ||
Charset.pm | ||
Circulation.pm | ||
ClassSortRoutine.pm | ||
ClassSource.pm | ||
Context.pm | ||
Contract.pm | ||
CourseReserves.pm | ||
Creators.pm | ||
Debug.pm | ||
Heading.pm | ||
HoldsQueue.pm | ||
HTML5Media.pm | ||
Images.pm | ||
ImportBatch.pm | ||
ImportExportFramework.pm | ||
InstallAuth.pm | ||
Installer.pm | ||
ItemCirculationAlertPreference.pm | ||
Items.pm | ||
Koha.pm | ||
Labels.pm | ||
Languages.pm | ||
Letters.pm | ||
Linker.pm | ||
Log.pm | ||
MarcModificationTemplates.pm | ||
Matcher.pm | ||
Members.pm | ||
Message.pm | ||
NewsChannels.pm | ||
Output.pm | ||
Overdues.pm | ||
Patroncards.pm | ||
Print.pm | ||
Record.pm | ||
Reports.pm | ||
Reserves.pm | ||
Ris.pm | ||
RotatingCollections.pm | ||
Scheduler.pm | ||
Scrubber.pm | ||
Search.pm | ||
Serials.pm | ||
Service.pm | ||
ShelfBrowser.pm | ||
SMS.pm | ||
SocialData.pm | ||
Stats.pm | ||
Suggestions.pm | ||
Tags.pm | ||
Templates.pm | ||
TmplToken.pm | ||
TmplTokenType.pm | ||
TTParser.pm | ||
UsageStats.pm | ||
XISBN.pm | ||
XSLT.pm |