Bug 40697 - Failures on batch record import because of fkconstraint should report in job report
Summary: Failures on batch record import because of fkconstraint should report in job ...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-22 18:36 UTC by Lisette Scheer
Modified: 2025-08-22 18:36 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Current display in staff interface (108.75 KB, image/png)
2025-08-22 18:36 UTC, Lisette Scheer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lisette Scheer 2025-08-22 18:36:11 UTC
Created attachment 185722 [details]
Current display in staff interface

If a import fails because of an FK_Constraint issue, there is no helpful information in the interface.

It would be very helpful for users if it show that, for example, the branch wasn't valid. 
I've attached a screenshot of what it looks like in the interface.

Example in worker-output.log:

DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE) at /usr/share/koha/lib/Koha/Object.pm line 172
Broken FK constraint at /usr/share/koha/lib/Koha/BackgroundJob/MARCImportCommitBatch.pm line 90.
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE) at /usr/share/koha/lib/Koha/Object.pm line 172
Broken FK constraint at /usr/share/koha/lib/Koha/BackgroundJob/MARCImportCommitBatch.pm line 90.
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE) at /usr/share/koha/lib/Koha/Object.pm line 172
Broken FK constraint at /usr/share/koha/lib/Koha/BackgroundJob/MARCImportCommitBatch.pm line 90.