Improved update of language items
authorMarcel Werk <burntime@woltlab.com>
Thu, 13 Mar 2014 18:26:10 +0000 (19:26 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 13 Mar 2014 18:26:10 +0000 (19:26 +0100)
wcfsetup/install/files/lib/data/language/LanguageEditor.class.php

index 06163c080e97ed729dcce136916f0b5460a183b3..dc133dc22fc028d500066b73d6ada23e88a9888f 100644 (file)
@@ -235,9 +235,9 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                                
                                if ($updateExistingItems) {
                                        $sql .= " ON DUPLICATE KEY
-                                       UPDATE                  languageItemValue = IF(languageItemOriginIsSystem = 0, languageItemValue, VALUES(languageItemValue)),
-                                                               languageCategoryID = VALUES(languageCategoryID),
-                                                               languageUseCustomValue = 0";
+                                       UPDATE                  languageUseCustomValue = IF(languageItemValue = VALUES(languageItemValue), languageUseCustomValue, 0),
+                                                               languageItemValue = IF(languageItemOriginIsSystem = 0, languageItemValue, VALUES(languageItemValue)),
+                                                               languageCategoryID = VALUES(languageCategoryID)";
                                }
                                
                                $statement = WCF::getDB()->prepareStatement($sql);