Fixed i18n validation for setups with only one available language
authorAlexander Ebert <ebert@woltlab.com>
Wed, 25 Sep 2013 19:19:14 +0000 (21:19 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 25 Sep 2013 19:19:14 +0000 (21:19 +0200)
wcfsetup/install/files/lib/system/language/I18nHandler.class.php

index 20be5d451058e9488280507f6accf4bc5e5f2213..56207d1137aec1733f2fcaa146ccba0961b407bd 100644 (file)
@@ -214,6 +214,11 @@ class I18nHandler extends SingletonFactory {
         * @return      boolean
         */
        public function validateValue($elementID, $requireI18n = false, $permitEmptyValue = false) {
+               // do not force i18n if only one language is available
+               if ($requireI18n && count($this->availableLanguages) == 1) {
+                       $requireI18n = false;
+               }
+               
                if ($this->isPlainValue($elementID)) {
                        // plain values may be left empty
                        if ($permitEmptyValue) {