Description
If you have a feed with a field mapping that references an asset as a default value for an asset field. If you delete the referenced default asset it causes the following error when loading the feed mapping page:
craft\helpers\Cp::elementChipHtml(): Argument #1 ($element) must be of type craft\base\ElementInterface, null given
This causes the Feed Me field mapping CP path to throw a Server Error, meaning you cannot edit the field mapping data through the CP anymore.
In order to fix this, I had a do a DB migration which modified the fieldMapping column to remove the default asset ID data, so it could be edited again resaved to update the data properly.
Steps to reproduce
- Serup a feed which has an asset field
- Set a default asset in the feed
- Delete the asset
- Load the feed mapping and get a Server Error.
Additional info
- Craft version: 5.8.18
- PHP version: 8.3
- Database driver & version: MySQL 8.0.40
- Plugins & versions: