feed-me icon indicating copy to clipboard operation
feed-me copied to clipboard

Unable to clear an entry’s asset field

Open sampsonpete opened this issue 5 years ago • 1 comments

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

  1. Set up Google Sheet import for entries, with an asset field.
  2. Assign an image filename in the spreadsheet, run the feed and confirm the image is selected in Craft.
  3. 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

sampsonpete avatar Jul 20 '20 17:07 sampsonpete

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.

grokcodile avatar Nov 03 '21 18:11 grokcodile

Resolved in https://github.com/craftcms/feed-me/pull/1228

angrybrad avatar Feb 10 '23 00:02 angrybrad

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) 🎉

brandonkelly avatar Mar 17 '23 21:03 brandonkelly