Variation titles missing, along with any fields with same name as product

Created on 18 June 2024, 11 days ago
Updated 19 June 2024, 9 days ago

Problem/Motivation

This is using the DEV version on D10.

In trying to work out why Variation titles are not set on import (which is a required field so I would expect to be populated) I see:

https://git.drupalcode.org/project/commerce_smart_importer/-/blob/8.x-1....

Which I think has the effect of for any variations excluding the 'title' from the config. This is fine if we are to set this elsewhere however it doesn't look like we are.

If we remove this condition the field appears in the template CSV to export and if I feed in a test row I now see a warning about missing data on the title field (Will lodge another issue about this as I think it relates to not handling field names that are the same between product and variation.

Steps to reproduce

Try and import a product with a simple variation. Runs. (Various errors which I've patched around array key indices not being where they should)

Result - we see a product variation with no title - but this is a required field.

Proposed resolution

We should not be creating entities with required fields that don't exist. We should have variations with a title.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @luke.stewart
  • Status changed to Needs review 9 days ago
  • I've updated the title to address that this now includes a fix for both the title but also any other field where the field name is the same between the product and the variation.

    For example if you have field_image on both product and variation only the variation gets populated. With the attached we can now populate both.

    Note. I've not tested this on other functionality of the importer.

    This changes the format of the Template used to upload data so any existing imports you need to redownload the template and adjust the data into the relevant columns.

Production build 0.69.0 2024