From 51a9327cdf77a871c102e5169c8340d9ddfe5206 Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Fri, 24 Nov 2023 18:43:22 -0800 Subject: [PATCH] backport https://github.com/craftcms/feed-me/pull/1365 --- CHANGELOG.md | 1 + src/fields/SuperTable.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 431ea434..d3121b4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Added the ability to provide a filename for importing assets via the assets field if you choose to “Create asset from URL”. ([#749](https://github.com/craftcms/feed-me/issues/749)) - Fixed a bug where you could not override feed settings with `false` if you used a `config/feed-me.php` config file. ([#1352](https://github.com/craftcms/feed-me/issues/1352)) - Fixed a bug where `queueTtr`, `queueMaxRetry`, and `assetDownloadCurl` settings were being ignored if you used a `config/feed-me.php` config file. ([#1356](https://github.com/craftcms/feed-me/issues/1356)) +- Fixed a PHP error that could occur when importing into a relational field inside of Super Table under certain circumstances. ([#1364](https://github.com/craftcms/feed-me/issues/1364)) ## 4.7.0 - 2023-07-06 diff --git a/src/fields/SuperTable.php b/src/fields/SuperTable.php index 205183cb..390e2a47 100644 --- a/src/fields/SuperTable.php +++ b/src/fields/SuperTable.php @@ -121,7 +121,7 @@ public function parseField() $parsedValue = $this->_parseSubField($nodePaths, $subFieldHandle, $subFieldInfo); if (isset($fieldData[$key])) { - $fieldData[$key] = array_merge_recursive($fieldData[$key], $parsedValue); + $fieldData[$key] = is_array($parsedValue) ? array_merge_recursive($fieldData[$key], $parsedValue) : $fieldData[$key]; } else { $fieldData[$key] = $parsedValue; }