Add support for enclosure to csv import with paste

Created on 17 April 2017, over 8 years ago
Updated 5 August 2025, 9 days ago

Problem/Motivation

Currently the csv import with "Copy & Paste" doesn't support csv cell enclosure. That is, for example, if the following csv is pasted and imported, the number of the resulting table columns become 3.

a,aaa
b,"bb,b"
"c","cc,c"

It's because each row is separated by the specified delimiter in a simple manner.


$cols = explode($col_delimiter, $row);

Proposed resolution

Add enclosure support by replacing the following


$cols = explode($col_delimiter, $row);

with


$cols = str_getcsv($row, $col_delimiter);

Remaining tasks


Review the patch

User interface changes

(None)

API changes

(None)

Data model changes

(None)

πŸ› Bug report
Status

Downport

Version

3.0

Component

Code

Created by

πŸ‡―πŸ‡΅Japan hgoto

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024