[BUGFIX] Add placeholder to date picker form elements 41/55841/2
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Tue, 20 Feb 2018 17:20:01 +0000 (18:20 +0100)
committerFrans Saris <franssaris@gmail.com>
Tue, 20 Feb 2018 19:45:37 +0000 (20:45 +0100)
Add the possibility to define a placeholder html attribute for
date picker form elements.

Resolves: #82514
Releases: master, 8.7
Change-Id: I7bf272d4e1e9b0af1c15e6ceeb6e1b91afba327e
Reviewed-on: https://review.typo3.org/55841
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/form/Classes/ViewHelpers/Form/DatePickerViewHelper.php
typo3/sysext/form/Configuration/Yaml/FormEditorSetup.yaml

index 7d5dcc4..a758dc1 100644 (file)
@@ -81,7 +81,7 @@ class DatePickerViewHelper extends AbstractFormFieldViewHelper
         $enableDatePicker = $this->arguments['enableDatePicker'];
         $dateFormat = $this->arguments['dateFormat'];
         $previewMode = (bool)$this->arguments['previewMode'];
-        $placeholder = $this->arguments['placeholder'];
+        $placeholder = $this->arguments['placeholder'] ?? $this->arguments['additionalAttributes']['placeholder'];
 
         $name = $this->getName();
         $this->registerFieldNameForFormTokenGeneration($name);
index 6ed435a..1763dc3 100644 (file)
@@ -529,6 +529,12 @@ TYPO3:
                     templateName: 'Inspector-TextEditor'
                     label: 'formEditor.elements.DatePicker.editor.dateFormat.label'
                     propertyPath: 'properties.dateFormat'
+                  350:
+                    identifier: 'placeholder'
+                    templateName: 'Inspector-TextEditor'
+                    label: 'formEditor.elements.TextMixin.editor.placeholder.label'
+                    propertyPath: 'properties.fluidAdditionalAttributes.placeholder'
+                    doNotSetIfPropertyValueIsEmpty: true
                   400:
                     identifier: 'enableDatePicker'
                     templateName: 'Inspector-CheckboxEditor'