feed-me
feed-me copied to clipboard
Unable to clear an entry’s asset field
Description
I’m importing entries (from a Google Sheet) with an asset field that works fine for assigning images but I can’t seem to clear the field again through the feed import.
I’d imagine that entering an empty string would remove the selected asset but nothing is changed. The previously selected image is still in place after running the feed. I’ve also tried entering null as mentioned in this older issue #213 but it doesn’t make a difference.
Steps to reproduce
- Set up Google Sheet import for entries, with an asset field.
- Assign an image filename in the spreadsheet, run the feed and confirm the image is selected in Craft.
- Delete the image filename in the spreadsheet, re-run the feed and check the entry in Craft. The previous image is still assigned instead of an empty asset field.
Additional info
- Craft version: 3.4.28.1
- PHP version: 7.0.32
- Database driver & version: MySQL 5.5.5
- Plugins & versions: FeedMe 4.2.3
I am seeing the same issue with importing a JSON feed where a value changes between a string value to null ,or even "", on subsequent imports for the same element. The original value never overwrites with the new blank or null value.
Resolved in https://github.com/craftcms/feed-me/pull/1228
Feed Me 4.6.0 (Craft 3) and 5.1.0 (Craft 4) have been released with the new “Set Empty Values” setting, which resolves this (via #1228) 🎉