You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered:
daltonrooney
changed the title
Can't set a lightswitch field value to false if the default value is true
Can't set a lightswitch field value to false in entry sub-fields
Jan 8, 2025
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.
Additional info
The text was updated successfully, but these errors were encountered: