[BUGFIX] EXT:form - bring back "Show message in label" 46/44946/3
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Thu, 26 Nov 2015 10:10:47 +0000 (11:10 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 27 Nov 2015 14:58:31 +0000 (15:58 +0100)
Respect the "Show message in label" option for validations.

Resolves: #71514
Releases: master
Change-Id: Id22885c88915fe38ffae0068a6d0c19592fed828
Reviewed-on: https://review.typo3.org/44946
Reviewed-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Carlos Meyer <cm@davitec.de>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/form/Classes/Domain/Builder/ValidationBuilder.php

index 3aa137b..b2a638d 100644 (file)
@@ -147,7 +147,12 @@ class ValidationBuilder
                     if ($validator instanceof AbstractValidator) {
                         $validator->setRawArgument($rawArgument);
                         $validator->setFormUtility($this->formUtility);
-                        $mandatoryMessage = $validator->renderMessage($ruleArguments['message.'], $ruleArguments['message']);
+
+                        if ((int)$ruleArguments['showMessage'] === 1) {
+                            $mandatoryMessage = $validator->renderMessage($ruleArguments['message.'], $ruleArguments['message']);
+                        } else {
+                            $mandatoryMessage = NULL;
+                        }
 
                         $this->rules[$this->configuration->getPrefix()][$fieldName][] = array(
                             'validator' => $validator,
@@ -233,7 +238,9 @@ class ValidationBuilder
         if ($this->getRulesByElementName($key)) {
             $rules = $this->getRulesByElementName($key);
             foreach ($rules as $rule) {
-                $mandatoryMessages[] = $rule['mandatoryMessage'];
+                if ($rule['mandatoryMessage']) {
+                    $mandatoryMessages[] = $rule['mandatoryMessage'];
+                }
             }
         }
         return $mandatoryMessages;