Skip to content

Commit 675ea28

Browse files
committed
Fix NotModifiedContentFilter when creating new translation
1 parent 877d537 commit 675ea28

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Filter/NotModifiedContentFilter.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use CodeRhapsodie\EzDataflowBundle\Core\FieldComparator\FieldComparatorInterface;
88
use CodeRhapsodie\EzDataflowBundle\Model\ContentUpdateStructure;
99
use Ibexa\Contracts\Core\Repository\ContentService;
10+
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
1011
use Psr\Log\LoggerAwareTrait;
1112

1213
/**
@@ -37,7 +38,12 @@ public function __invoke($data)
3738
if ($data->getId()) {
3839
$content = $this->contentService->loadContent($data->getId(), [$data->getLanguageCode()]);
3940
} else {
40-
$content = $this->contentService->loadContentByRemoteId($data->getRemoteId(), [$data->getLanguageCode()]);
41+
try {
42+
$content = $this->contentService->loadContentByRemoteId($data->getRemoteId(), [$data->getLanguageCode()]);
43+
} catch (NotFoundException $e) {
44+
// New translation
45+
return $data;
46+
}
4147
}
4248

4349
foreach ($data->getFields() as $identifier => $hash) {

0 commit comments

Comments
 (0)