Error importing with Tailor in CSV mode

I get the following error message, when trying to import data into a Tailor content type (Blog post), using the backend web interface:


*"SQLSTATE[01000]: Warning: 1265 Data truncated for column 'relation_id' at row 1 (SQL: insert into `xc_0195da17262d425a997e843243dd25d4j` (`field_name`, `parent_id`, `relation_id`, `relation_type`) values (categories, 1, 42|47|49|83, Tailor\Models\EntryRecord@xc_482b0668d7d241cf87cb9b96cae75548c))" on line 760 of /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php*

The CSV file I’m using to test is the same file that Tailor exports from the content type. So the tool is not able to import the same data that previously exported.

This is the context:

The blueprint of the content type:


uuid: 0195da17-262d-425a-997e-843243dd25d4
handle: Content\BlogPost
type: stream
name: Blog Post
drafts: false

primaryNavigation:
    label: Content
    icon: octo-icon-file
    order: 100

navigation:
    icon: icon-bookmark
    parent: Content\BlogPost
    order: 10

fields:

    basic_data_fields:
        tab: Meta Data
        type: mixin
        source: Content\BasicData
    authors:
        tab: Meta Data
        label: Authors
        type: entries
        source: Content\Author
        commentAbove: 'Select the authors of this post'
        validation:
                    -required
    main_image:
        tab: Meta Data
        label: Main image
        type: fileupload
        mode: image
        maxFiles: 1
    categories:
        tab: Meta Data
        label: Categories
        commentAbove: 'Select the categories this post belongs to'
        type: entries
        source: Content\Category    
    content:
        tab: Content
        label: Full text
        type: richeditor
        span: adaptive
        validation:
                    -required

Each Blog post could have several categories and authors, so these are the blueprints for those entities:

For authors:



uuid: ad40f25f-4485-486d-867f-87884dd08d7a
handle: Content\Author
type: entry
name: Author
drafts: false

navigation:
    parent: Content\Category
    icon: icon-magic
    order: 6

fields:
    description:
        label: Description
        type: textarea
        size: small
    photo:
        label: Photo
        type: mediafinder
        mode: image

For categories:


uuid: 482b0668-d7d2-41cf-87cb-9b96cae75548
handle: Content\Category
type: structure
name: Category
drafts: false

structure:
    maxDepth: 3

primaryNavigation:
    label: Taxonomies
    icon: icon-table
    order: 101

navigation:
    icon: icon-tree
    parent: Content\Category
    order: 5

fields:
    description:
        label: Description

Finally, this is the content of the basic CSV file, with only one record:


ID^Title^Slug^Status^Language^"Main image"^"Full text"^Categories^Authors^Enabled^"Publish Date"^"Expiry Date"^"Entry Type"
1^"Sample post"^sample-post^published^es^http://localhost:8082/storage/app/uploads/public/63e/2d7/ae3/63e2d7ae3eab1684532091.jpg^"<p>Lorem ipsum lorem ipsum Lorem ipsum lorem ipsum Lorem ipsum lorem ipsum Lorem ipsum lorem ipsum Lorem ipsum lorem ipsum </p>"^52|53|54|61^359|360^1^^^

Here I’m using ^ as a separator character. The result is the same when using a comma.

After excluding some fields, the export finishes without errors, but only the first category and author are loaded. So the list of ids separated by pipes is not working to load the relationships correctly.

Your suggestions will be greatly appreciated.

Did you try json? For me it works just perfect!

You are right. JSON works just fine. However, CSV import should work. I think it is a bug that should be fixed.

Best regards.