Skip to content

Commit

Permalink
Merge branch '5.x' into 6.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
angrybrad committed Jul 18, 2024
2 parents 4d55d26 + 09a5995 commit 237c9ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Feed Me

## Unreleased

- Fixed a PHP error that could occur when importing Assets that had a missing filename. ([#1481](https://github.com/craftcms/feed-me/pull/1481))

## 6.2.0 - 2024-07-09

> **Warning**
Expand Down
6 changes: 4 additions & 2 deletions src/fields/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion src/templates/_includes/fields/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}) }}
</div>
Expand Down

0 comments on commit 237c9ac

Please sign in to comment.