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