diff --git a/src/fields/Assets.php b/src/fields/Assets.php index a1bdd27f..09978fed 100644 --- a/src/fields/Assets.php +++ b/src/fields/Assets.php @@ -118,8 +118,10 @@ public function parseField(): mixed $base64ToUpload = []; $filenamesFromFeed = $upload ? DataHelper::fetchArrayValue($this->feedData, $this->fieldInfo, 'options.filenameNode') : null; - // see https://github.com/craftcms/feed-me/issues/1471 - $filenamesFromFeed = array_splice($filenamesFromFeed, $nodeKey, count($value)); + if ($filenamesFromFeed) { + // see https://github.com/craftcms/feed-me/issues/1471 + $filenamesFromFeed = array_splice($filenamesFromFeed, $nodeKey, count($value)); + } // Fire an 'onAssetFilename' event $event = new AssetFilenameEvent([ diff --git a/src/templates/_includes/fields/assets.html b/src/templates/_includes/fields/assets.html index 1e49b21b..eb94839f 100644 --- a/src/templates/_includes/fields/assets.html +++ b/src/templates/_includes/fields/assets.html @@ -75,7 +75,7 @@ label: 'Use this filename for assets created from URL:'|t('feed-me'), name: 'options[filenameNode]', value: hash_get(feed.fieldMapping, optionsPath ~ '.filenameNode') ?: '', - options: feedData, + options: feedData|filter(option => option.value != 'usedefault'), class: 'selectize fullwidth', }) }}