From a72823141fcec088ed4bd582b6c8561509e430a5 Mon Sep 17 00:00:00 2001 From: Iwona Just Date: Fri, 17 Nov 2023 13:15:43 +0000 Subject: [PATCH 1/2] order of events for setting enabled & enabledForSite --- src/services/Process.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/services/Process.php b/src/services/Process.php index bb86ab72..0ddd4b7c 100644 --- a/src/services/Process.php +++ b/src/services/Process.php @@ -369,9 +369,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 @@ -390,8 +387,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')) { From 62918d8cf45f4f48126e3210375db8f2599ce1f4 Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Fri, 24 Nov 2023 18:56:27 -0800 Subject: [PATCH 2/2] changelog for https://github.com/craftcms/feed-me/pull/1381 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd7d03ca..74f8c099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - 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)) - 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)) ## 4.7.0 - 2023-07-06