Skip to content

Commit

Permalink
Merge branch 'v4' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybrad committed Nov 25, 2023
2 parents 3074881 + 62918d8 commit 0b6cc61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fixed a bug where the `maxRelations` setting was not being respected for relational fields. ([#1354](https://github.com/craftcms/feed-me/issues/1354))
- Fixed a bug where importing assets with “Use existing assets” could create duplicate assets. ([#1348](https://github.com/craftcms/feed-me/issues/1348))
- Fixed a bug where importing Address data from the Google Maps plugin could cause duplicate Addresses if the Address already existed. ([#1370](https://github.com/craftcms/feed-me/pull/1370))
- Fixed a bug where updating entry statuses for a site in a site group, would update statuses for all sites in the site group instead of the targeted one. ([#1208](https://github.com/craftcms/feed-me/issues/1208))

## 5.2.0 - 2023-07-06

Expand Down
8 changes: 5 additions & 3 deletions src/services/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,6 @@ public function processFeed($step, $feed, &$processedElementIds, $feedData = nul
}
}

// Set the attributes for the element
$element->setAttributes($attributeData, false);

$contentData = [];
if (isset($attributeData['enabled'])) {
// Set the site-specific status as well, but retain all other site statuses
Expand All @@ -395,8 +392,13 @@ public function processFeed($step, $feed, &$processedElementIds, $feedData = nul
$element->setEnabledForSite($enabledForSite);
$contentData['enabled'] = $element->enabled;
$contentData['enabledForSite'] = $element->getEnabledForSite($element->siteId);

unset($attributeData['enabled']);
}

// Set the attributes for the element
$element->setAttributes($attributeData, false);

// Then, do the same for custom fields. Again, this should be done after populating the element attributes
foreach ($feed['fieldMapping'] as $fieldHandle => $fieldInfo) {
if (Hash::get($fieldInfo, 'field')) {
Expand Down

0 comments on commit 0b6cc61

Please sign in to comment.