Bug 40846 - Job Status should not be Failed if a record import result in a item update
Summary: Job Status should not be Failed if a record import result in a item update
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Nick Clemens (kidclamp)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: release-notes-needed
Depends on:
Blocks:
 
Reported: 2025-09-22 12:41 UTC by Mathieu Saby
Modified: 2026-01-20 14:37 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: Unsponsored
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
26.05.00
Circulation function:


Attachments
Bug 40846: Improve handling of ignored records (4.06 KB, patch)
2025-10-21 15:44 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40846: Improve handling of ignored records (4.10 KB, patch)
2025-12-13 08:54 UTC, David Nind
Details | Diff | Splinter Review
Bug 40846: Improve handling of ignored records (4.17 KB, patch)
2026-01-20 10:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Saby 2025-09-22 12:41:40 UTC
If you import staged records with the sole purpose of updating the items (Action if matching record found: = Ignore incoming record ; Action if no match is found:Ignore incoming record ; Check for embedded item record data = Yes ; How to process items = Replace items if ...), at the end of the operation Koha display " Failed" job status.
If the items were successfully updted, the status should be Success
Comment 1 Nick Clemens (kidclamp) 2025-10-21 15:44:46 UTC
Created attachment 188230 [details] [review]
Bug 40846: Improve handling of ignored records

Currently, a jobis marked failed if there are no records added or updated.
We should take ignored records into account.

Additionally, I mark the job failed when the number of records processed doesn't equal the number of records in the bacth

To test:
1 - Export some records from your Koha, include some with items
2 - Stage and import those records into Koha, matching on biblionumber, ignoring matcheds, updating items
3 - View the import job, it is marked failed
4 - View the batch, all records imported
5 - Apply patch, restart all
6 - Stage/import as before
7 - Job is now marked finished
8 - Records imported as before
Comment 2 David Nind 2025-12-13 08:54:51 UTC
Created attachment 190479 [details] [review]
Bug 40846: Improve handling of ignored records

Currently, a jobis marked failed if there are no records added or updated.
We should take ignored records into account.

Additionally, I mark the job failed when the number of records processed doesn't equal the number of records in the bacth

To test:
1 - Export some records from your Koha, include some with items
2 - Stage and import those records into Koha, matching on biblionumber, ignoring matcheds, updating items
3 - View the import job, it is marked failed
4 - View the batch, all records imported
5 - Apply patch, restart all
6 - Stage/import as before
7 - Job is now marked finished
8 - Records imported as before

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Martin Renvoize (ashimema) 2026-01-20 10:58:11 UTC
Created attachment 191671 [details] [review]
Bug 40846: Improve handling of ignored records

Currently, a job is marked failed if there are no records added or updated.
We should take ignored records into account.

Additionally, I mark the job failed when the number of records processed
doesn't equal the number of records in the batch.

To test:
1) Export some records from your Koha, include some with items
2) Stage and import those records into Koha, matching on biblionumber,
   ignoring matcheds, updating items
3) View the import job, it is marked failed
4) View the batch, all records imported
5) Apply patch, restart all
6) Stage/import as before
7) Job is now marked finished
8) Records imported as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 4 Lucas Gass (lukeg) 2026-01-20 14:37:11 UTC
Nice work everyone!

Pushed to main for 26.05
Comment 5 Lucas Gass (lukeg) 2026-01-20 14:37:46 UTC
please add release notes