File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1134,6 +1134,29 @@ public function postProcess()
1134
1134
);
1135
1135
}
1136
1136
}
1137
+ // Copy default language values to empty translations
1138
+ $ defaultLang = (int ) Configuration::get ('PS_LANG_DEFAULT ' );
1139
+ foreach (Language::getLanguages (false ) as $ lang ) {
1140
+ $ idLang = (int ) $ lang ['id_lang ' ];
1141
+ if (empty ($ post ->title [$ idLang ])) {
1142
+ $ post ->title [$ idLang ] = $ post ->title [$ defaultLang ] ?? '' ;
1143
+ }
1144
+ if (empty ($ post ->content [$ idLang ])) {
1145
+ $ post ->content [$ idLang ] = $ post ->content [$ defaultLang ] ?? '' ;
1146
+ }
1147
+ if (empty ($ post ->excerpt [$ idLang ])) {
1148
+ $ post ->excerpt [$ idLang ] = $ post ->excerpt [$ defaultLang ] ?? '' ;
1149
+ }
1150
+ if (empty ($ post ->meta_title [$ idLang ])) {
1151
+ $ post ->meta_title [$ idLang ] = $ post ->meta_title [$ defaultLang ] ?? '' ;
1152
+ }
1153
+ if (empty ($ post ->meta_description [$ idLang ])) {
1154
+ $ post ->meta_description [$ idLang ] = $ post ->meta_description [$ defaultLang ] ?? '' ;
1155
+ }
1156
+ if (empty ($ post ->link_rewrite [$ idLang ])) {
1157
+ $ post ->link_rewrite [$ idLang ] = $ post ->link_rewrite [$ defaultLang ] ?? '' ;
1158
+ }
1159
+ }
1137
1160
if (!count ($ this ->errors )) {
1138
1161
try {
1139
1162
$ post ->save ();
You can’t perform that action at this time.
0 commit comments