2 Commits

Author SHA1 Message Date
Jérémy J
131045afe8 Fix NotModifiedContentFilter when creating new translation 2024-02-05 15:55:55 +01:00
jeremycr
0a47f788dc Allow Dataflow 4 (#43) 2023-07-27 09:51:45 +02:00
2 changed files with 8 additions and 2 deletions

View File

@@ -42,7 +42,7 @@
},
"require": {
"php": "^7.3||^8.0",
"code-rhapsodie/dataflow-bundle": "^3.0",
"code-rhapsodie/dataflow-bundle": "^3.0||^4.0",
"ezsystems/ezplatform-admin-ui": "^2.3",
"ezsystems/ezplatform-kernel": "^1.3"
},

View File

@@ -7,6 +7,7 @@ namespace CodeRhapsodie\EzDataflowBundle\Filter;
use CodeRhapsodie\EzDataflowBundle\Core\FieldComparator\FieldComparatorInterface;
use CodeRhapsodie\EzDataflowBundle\Model\ContentUpdateStructure;
use eZ\Publish\API\Repository\ContentService;
use eZ\Publish\API\Repository\Exceptions\NotFoundException;
use Psr\Log\LoggerAwareTrait;
/**
@@ -37,7 +38,12 @@ class NotModifiedContentFilter
if ($data->getId()) {
$content = $this->contentService->loadContent($data->getId(), [$data->getLanguageCode()]);
} else {
$content = $this->contentService->loadContentByRemoteId($data->getRemoteId(), [$data->getLanguageCode()]);
try {
$content = $this->contentService->loadContentByRemoteId($data->getRemoteId(), [$data->getLanguageCode()]);
} catch (NotFoundException $e) {
// New translation
return $data;
}
}
foreach ($data->getFields() as $identifier => $hash) {