- Issue created by @kensuke-imamura
Nice! I came across the same issue. I used a similar patch and it solved my problem. The only difference is when checking for an empty line, I copied the logic from L422. I'm not sure if there are situations where this will actually make a difference, but I'll upload it anyway.
Corrected the patch format (missing the first line) in the previous 2 patches.
- Status changed to Needs review
over 1 year ago 8:40pm 27 February 2024 - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 536 pass - last update
over 1 year ago Patch Failed to Apply - πΊπΈUnited States jrockowitz Brooklyn, NY
Does the CVS that is being imported have empty lines?
Can you upload and example CSV that is having this issue?
- Status changed to Postponed: needs info
6 months ago 12:07pm 24 November 2024 - π§πͺBelgium kubrick
Patch #3 solved an issue I was having with big CSV's.
- πΊπΈUnited States jwineichen
Patch #3 also worked for me. I was importing a CSV with 1900 lines. Without the patch, the completion message said it created a little under 300 records and then updated 1600 or something, even though I added sid and uuid columns so they should have all been recognized as unique. With the patch, the the upload completed successfully and I've got 1900 submissions now.
- Status changed to Needs review
1 day ago 1:33pm 5 June 2025 - π«π·France pacproduct
I think ths issue is not specific to big CSVs but to big CSVs that contain entries with line breaks, as they get interpreted as new lines with
fgets
where they should not.I was facing the following errors in my case because of multiline webform elements:
... > [warning] Line nΒ°101: 28 values expected and only 3 found. > [warning] Line nΒ°102: 28 values expected and only 5 found. ...
Using
fgetcsv
as suggested seems to be the way to go, and I can confirm that the patch in #3 does solve the issue as it counts lines in a similar way to\Drupal\webform_submission_export_import\WebformSubmissionExportImportImporter::getTotal
, although the latter usesif (!empty($line) && !is_null(array_pop($line))) {
instead ofif (!empty($line) && $line !== ['']) {
, I'm not sure which approach is the best.Thanks! :)