Skip to content

Commit

Permalink
Merge pull request #1386 from craftcms/bugfix/1346-part-2
Browse files Browse the repository at this point in the history
Part 2 of 1346
angrybrad authored Nov 28, 2023
2 parents 87901f2 + dd4383d commit 617c1cd
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

5 changes: 4 additions & 1 deletion src/fields/Matrix.php
Original file line number Diff line number Diff line change
@@ -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;
}

5 changes: 4 additions & 1 deletion src/fields/SuperTable.php
Original file line number Diff line number Diff line change
@@ -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;
}

5 changes: 4 additions & 1 deletion src/services/Fields.php
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 617c1cd

Please sign in to comment.