Problem/Motivation
Even if it not documented on the contract (\Drupal\single_content_sync\ContentImporterInterface::importFromFile()) the content import process can fail with exceptions and when the happens the batch import process dies with an error instead of gracefully continuing the import and reporting back import errors at the end.
Steps to reproduce
Simplest dirty hack to trigger an exception:
1. Log in as a super admin user
2. Navigate to the /admin/content/import page
3. Select a zip file (which was generated by exporting content previously, then by editing the .yml file in it so some required field e.g. the title is empty, then compress the zip)
4. Click on Import
5. Anticipate the complete batch import died (see attached screenshot).
Proposed resolution
Catch import errors meanwhile the batch process and report them to the user at the end.
Remaining tasks
User interface changes
API changes
I do not think so that the touched methods were covered by BC.
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screenshot_20250303_135709.png | 320.28 KB | mxr576 |
| Screenshot_20250303_134258.png | 115.01 KB | mxr576 |
Issue fork single_content_sync-3510655
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mxr576Raised an MR againts 2.0.x but the fix also applies to 1.4.x and should be merged to that branch too.
The outcome after the fix is applied.
Comment #4
mxr576Comment #5
mxr576Test suite failed for unrelated reasons.