When batch importing, the offset is fast forwarded using fgets() to jump ahead by the offset number of lines, but if your CSV has fields that include newlines in the value, this won't actually offset it by the right amount and you'll end up with errors like Row #101: 123 values expected and only 1 found

I think the fix is to just use fgetscsv() when advancing the offset. It's what we do in ::getTotal() to get the count so it seems logical here. MR incoming!

Issue fork webform-3568039

Command icon 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

drclaw created an issue. See original summary.

drclaw’s picture

Status: Active » Needs review

Merge Request added!

liam morland’s picture

drclaw’s picture

Oh yep that makes sense. I updated the MR with the same fix as 6.3.x

liam morland’s picture

Status: Needs review » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

drclaw’s picture

Ack sorry I didn't properly merge that backport and there was an extra fgetscsv() in the loop. I fixed it but only after you committed. Not sure best action to proceed. Here's the commit:

https://git.drupalcode.org/issue/webform-3568039/-/commit/da7035eadfee90...

  • liam morland committed 116d3cd2 on 6.2.x authored by drclaw
    fix: #3568039 Fix double fgetscsv() when fast forwarding offset
    
    Fixes...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.