Fixes issues with SmileyAddForm
authorMatthias Schmidt <gravatronics@live.com>
Thu, 8 Aug 2013 08:49:42 +0000 (10:49 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 8 Aug 2013 08:49:42 +0000 (10:49 +0200)
wcfsetup/install/files/acp/templates/smileyAdd.tpl
wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php

index 759520ec6d3e092d6ba4f9426f752bdd2a051c31..47f3139966c813101039737d8a841c697a9fe0cd 100644 (file)
@@ -37,8 +37,8 @@
                                        
                                        {if $errorField == 'smileyTitle'}
                                                <small class="innerError">
-                                                       {if $errorType == 'empty'}
-                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {if $errorType == 'empty' || $errorType == 'multilingual'}
+                                                               {lang}wcf.global.form.error.{$errorType}{/lang}
                                                        {else}
                                                                {lang}wcf.acp.smiley.smileyTitle.error.{@$errorType}{/lang}
                                                        {/if}
index 08e1b04d4923f7eee58cee32cddcd3986e2f45d6..15fbc9be5a4fb3a77ca309f578353e1a480dfebb 100644 (file)
@@ -70,7 +70,7 @@ class SmileyAddForm extends AbstractForm {
        public $aliases = '';
        
        /**
-        * smileyPath
+        * path to the smiley file
         * @var string
         */
        public $smileyPath = '';
@@ -172,6 +172,7 @@ class SmileyAddForm extends AbstractForm {
                $this->smileyCode = '';
                $this->categoryID = 0;
                $this->showOrder = 0;
+               $this->smileyPath = '';
                
                I18nHandler::getInstance()->reset();
                
@@ -189,7 +190,12 @@ class SmileyAddForm extends AbstractForm {
                
                // validate title
                if (!I18nHandler::getInstance()->validateValue('smileyTitle')) {
-                       throw new UserInputException('smileyTitle');
+                       if (I18nHandler::getInstance()->isPlainValue('smileyTitle')) {
+                               throw new UserInputException('smileyTitle');
+                       }
+                       else {
+                               throw new UserInputException('smileyTitle', 'multilingual');
+                       }
                }
                
                if ($this->categoryID) {