diff --git a/src/Translation/Controller/CreateController.php b/src/Translation/Controller/CreateController.php index 54c3f5b55..761b5009a 100644 --- a/src/Translation/Controller/CreateController.php +++ b/src/Translation/Controller/CreateController.php @@ -64,7 +64,6 @@ public function __construct( description: 'translation_create_success_response' )] #[DefaultResponses([ - HttpResponseCodes::CONFLICT, HttpResponseCodes::NOT_FOUND, HttpResponseCodes::UNAUTHORIZED, ])] diff --git a/src/Translation/Repository/TranslationRepository.php b/src/Translation/Repository/TranslationRepository.php index c4c187b9b..70fc4d2df 100644 --- a/src/Translation/Repository/TranslationRepository.php +++ b/src/Translation/Repository/TranslationRepository.php @@ -17,7 +17,6 @@ namespace Pimcore\Bundle\StudioBackendBundle\Translation\Repository; use Pimcore\Bundle\StaticResolverBundle\Lib\Tools\AdminResolverInterface; -use Pimcore\Bundle\StudioBackendBundle\Exception\Api\ElementExistsException; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\InvalidLocaleException; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\NotFoundException; use Pimcore\Bundle\StudioBackendBundle\Translation\Schema\CreateTranslationData; @@ -26,7 +25,6 @@ use Pimcore\Model\Translation; use Pimcore\Model\Translation\Listing; use function in_array; -use function sprintf; /** * @internal @@ -53,9 +51,6 @@ public function getAllTranslations(string $locale): array return $list->getTranslations(); } - /** - * {@inheritdoc} - */ public function createTranslations(array $translationData): void { $languages = $this->adminResolver->getLanguages(); @@ -63,9 +58,7 @@ public function createTranslations(array $translationData): void /** @var CreateTranslationData $translation */ foreach ($translationData as $translation) { if ($this->getTranslationByKey($translation->getKey()) !== null) { - throw new ElementExistsException( - sprintf("Translation with key '%s' already exists", $translation->getKey()), - ); + continue; } $this->createTranslationEntry($translation->getKey(), $translation->getType(), $languages); diff --git a/src/Translation/Repository/TranslationRepositoryInterface.php b/src/Translation/Repository/TranslationRepositoryInterface.php index 2c9b40d98..6b02e99b2 100644 --- a/src/Translation/Repository/TranslationRepositoryInterface.php +++ b/src/Translation/Repository/TranslationRepositoryInterface.php @@ -16,7 +16,6 @@ namespace Pimcore\Bundle\StudioBackendBundle\Translation\Repository; -use Pimcore\Bundle\StudioBackendBundle\Exception\Api\ElementExistsException; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\InvalidLocaleException; use Pimcore\Bundle\StudioBackendBundle\Translation\Schema\TranslationData; use Pimcore\Model\Translation; @@ -33,9 +32,6 @@ interface TranslationRepositoryInterface */ public function getAllTranslations(string $locale): array; - /** - * @throws ElementExistsException - */ public function createTranslations(array $translationData): void; /** diff --git a/src/Translation/Service/TranslatorService.php b/src/Translation/Service/TranslatorService.php index 8f3e8e786..81afd80ea 100644 --- a/src/Translation/Service/TranslatorService.php +++ b/src/Translation/Service/TranslatorService.php @@ -42,9 +42,6 @@ public function __construct( $this->translatorBag = $this->getTranslatorBag(); } - /** - * {@inheritdoc} - */ public function createTranslations(CreateTranslation $translation): void { $this->translationRepository->createTranslations($translation->getTranslationData()); diff --git a/src/Translation/Service/TranslatorServiceInterface.php b/src/Translation/Service/TranslatorServiceInterface.php index f35b12844..40d66446f 100644 --- a/src/Translation/Service/TranslatorServiceInterface.php +++ b/src/Translation/Service/TranslatorServiceInterface.php @@ -16,7 +16,6 @@ namespace Pimcore\Bundle\StudioBackendBundle\Translation\Service; -use Pimcore\Bundle\StudioBackendBundle\Exception\Api\ElementExistsException; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\InvalidLocaleException; use Pimcore\Bundle\StudioBackendBundle\Translation\Schema\CreateTranslation; use Pimcore\Bundle\StudioBackendBundle\Translation\Schema\Translation; @@ -29,9 +28,6 @@ interface TranslatorServiceInterface { public const string DOMAIN = 'studio'; - /** - * @throws ElementExistsException - */ public function createTranslations(CreateTranslation $translation): void; /**