Commit dbef3fb 1 parent 2cf9be0 commit dbef3fb Copy full SHA for dbef3fb
File tree 1 file changed +8
-8
lines changed
Services/Object/classes/Translation
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -449,14 +449,14 @@ public function saveContentTranslationActivation(): void
449
449
->withRequest ($ this ->request )
450
450
->getData ();
451
451
$ this ->obj_trans ->setMasterLanguage ($ data ['lang ' ]);
452
- $ this ->obj_trans ->addLanguage (
453
- $ data [ ' lang ' ],
454
- $ this -> obj -> getTitle () ,
455
- $ this ->obj ->getDescription (),
456
- true
457
- );
458
- $ this -> obj_trans -> setDefaultTitle ( $ this -> obj -> getTitle () );
459
- $ this -> obj_trans -> setDefaultDescription ( $ this -> obj -> getDescription ());
452
+ if (! in_array ( $ data [ ' lang ' ], $ this ->obj_trans ->getLanguages ())) {
453
+ $ this -> obj_trans -> addLanguage (
454
+ $ data [ ' lang ' ] ,
455
+ $ this ->obj ->getTitle (),
456
+ $ this -> obj -> getDescription (),
457
+ true
458
+ );
459
+ }
460
460
$ this ->obj_trans ->save ();
461
461
462
462
$ this ->ctrl ->redirect ($ this , self ::CMD_LIST_TRANSLATIONS );
You can’t perform that action at this time.
0 commit comments