Skip to content

Can't set a lightswitch field value to false in entry sub-fields #1570

@daltonrooney

Description

@daltonrooney

Description

I have an entry type that contains a lightswitch field with a default value of true. I'm trying to import a CSV which does not include this value. The feed config has "Set Empty Values" set to true, and the field value is set to "Use default value" with the lightswitch disabled. When the new entry is created, the lightswitch field is enabled.

I tried adding a column to the CSV with a value of 0 and mapping the field to that instead, but the newly created entry also has the lightswitch enabled.

In the log, the field is not included in the list of fields that were included when the entry was created, so I assume this is the default value for the entry type.

It may be relevant to note that the entry being created is an inner element on an Entry field, so these are sub-field mappings, not mappings on the main element that is being created.

Update it does seem relevant that the entry being created is an inner element, as this problem doesn't occur if I import the sub-field entries first in their own feed.

Image Image Image Image

Additional info

  • Craft version: 5.5.9
  • PHP version: 8.2.22
  • Database driver & version: MySQL 8.0.36
  • Plugins & versions: Feed Me 6.6.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions