diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c96bca4..6432e3d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Fixed a bug where you could not use `false` to override feed settings in `config/feed-me.php`. ([#1380](https://github.com/craftcms/feed-me/issues/1380)) - Fixed a bug where importing nested element fields would not work in some scenarios. ([#1378](https://github.com/craftcms/feed-me/issues/1378)) - Fixed a bug where empty column headings in a feed would cause incorrect values to be selected in the pagination URL dropdown when mapping a feed. ([#1375](https://github.com/craftcms/feed-me/issues/1375)) +- Fixed a bug that could occur when using Feed Me with fields that have been entrified in Craft. ([1346](https://github.com/craftcms/feed-me/pull/1346)). ## 5.2.0 - 2023-07-06 diff --git a/src/fields/Matrix.php b/src/fields/Matrix.php index dd231357..77d69ea3 100644 --- a/src/fields/Matrix.php +++ b/src/fields/Matrix.php @@ -272,7 +272,10 @@ private function _parseSubField($feedData, $subFieldHandle, $subFieldInfo): mixe $subField = Hash::extract($this->field->getBlockTypeFields(), '{n}[handle=' . $subFieldHandle . ']')[0]; - if (!$subField instanceof $subFieldClassHandle) { + if ( + !$subField instanceof $subFieldClassHandle && + ($subField instanceof \craft\fields\Categories || $subField instanceof \craft\fields\Tags) + ) { $subFieldClassHandle = \craft\fields\Entries::class; } diff --git a/src/fields/SuperTable.php b/src/fields/SuperTable.php index 21262fa6..229da422 100644 --- a/src/fields/SuperTable.php +++ b/src/fields/SuperTable.php @@ -224,7 +224,10 @@ private function _parseSubField($feedData, $subFieldHandle, $subFieldInfo): mixe $subField = Hash::extract($this->field->getBlockTypeFields(), '{n}[handle=' . $subFieldHandle . ']')[0]; - if (!$subField instanceof $subFieldClassHandle) { + if ( + !$subField instanceof $subFieldClassHandle && + ($subField instanceof \craft\fields\Categories || $subField instanceof \craft\fields\Tags) + ) { $subFieldClassHandle = \craft\fields\Entries::class; } diff --git a/src/services/Fields.php b/src/services/Fields.php index f2a2d303..9219505b 100644 --- a/src/services/Fields.php +++ b/src/services/Fields.php @@ -210,7 +210,10 @@ public function parseField($feed, $element, $feedData, $fieldHandle, $fieldInfo) // if it hasn't changed - proceed as before // if it has changed - assume that we've entrified and adjust the $fieldClassHandle $field = Craft::$app->getFields()->getFieldByHandle($fieldHandle); - if (!$field instanceof $fieldClassHandle) { + if ( + !$field instanceof $fieldClassHandle && + ($field instanceof \craft\fields\Categories || $field instanceof \craft\fields\Tags) + ) { $fieldClassHandle = \craft\fields\Entries::class; }