Skip to content

Commit

Permalink
Merge branch 'v4' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	src/helpers/DataHelper.php
  • Loading branch information
angrybrad committed Mar 24, 2023
2 parents 66f92a9 + af2a301 commit e7759e2
Show file tree
Hide file tree
Showing 2 changed files with 7 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 into some 3rd party fields. ([#1264](https://github.com/craftcms/feed-me/issues/1264), [#1265](https://github.com/craftcms/feed-me/pull/1265))

## 5.1.1 - 2023-03-20

- Fixed a JavaScript error that would occur on case-sensitive filesystems when using Feed Me. ([#1260](https://github.com/craftcms/feed-me/pull/1260), [#1257](https://github.com/craftcms/feed-me/issues/1257), [#1258](https://github.com/craftcms/feed-me/issues/1258), [#1259](https://github.com/craftcms/feed-me/issues/1259))
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/DataHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ public static function fetchDefaultArrayValue($fieldInfo)
/**
* @param $feedData
* @param $fieldInfo
* @param array|FeedModel $feed
* @param array|FeedModel|null $feed
* @return array|ArrayAccess|mixed|null
*/
public static function fetchValue($feedData, $fieldInfo, $feed): mixed
public static function fetchValue($feedData, $fieldInfo, $feed = null): mixed
{
// $feed will be a FeedModel when calling `fetchValue` from an element
if ($feed instanceof FeedModel) {
Expand Down Expand Up @@ -174,7 +174,7 @@ public static function fetchValue($feedData, $fieldInfo, $feed): mixed
}

// If setEmptyValues is enabled allow overwriting existing data
if ($value === "" && $feed['setEmptyValues']) {
if ($feed !== null && $value === "" && $feed['setEmptyValues']) {
return $value;
}

Expand Down

0 comments on commit e7759e2

Please sign in to comment.