reverted: --- b/core/modules/datetime/tests/modules/datetime_states/src/Forms/StateForm.php +++ /dev/null @@ -1,70 +0,0 @@ - 'checkbox', - '#title' => $this->t('Invisible'), - ); - $form['toggle_disabled'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Disabled'), - ); - $form['toggle_required'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Required'), - ); - - - $form['date'] = array( - '#type' => 'datetime', - '#title' => $this->t('Datetime'), - '#description' => $this->t('A datetime form element.'), - '#states' => [ - 'invisible' => [ - ':input[name="toggle_invisible"]' => ['checked' => TRUE], - ], - 'disabled' => [ - ':input[name="toggle_disabled"]' => ['checked' => TRUE], - ], - 'required' => [ - ':input[name="toggle_required"]' => ['checked' => TRUE], - ], - ], - ); - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - } - -} only in patch2: unchanged: --- /dev/null +++ b/core/modules/datetime/tests/modules/datetime_states/src/Form/StateForm.php @@ -0,0 +1,75 @@ + 'checkbox', + '#title' => $this->t('Invisible'), + ); + $form['toggle_disabled'] = array( + '#type' => 'checkbox', + '#title' => $this->t('Disabled'), + ); + $form['toggle_required'] = array( + '#type' => 'checkbox', + '#title' => $this->t('Required'), + ); + + + $form['date'] = array( + '#type' => 'datetime', + '#title' => $this->t('Datetime'), + '#description' => $this->t('A datetime form element.'), + '#states' => [ + 'invisible' => [ + ':input[name="toggle_invisible"]' => ['checked' => TRUE], + ], + 'disabled' => [ + ':input[name="toggle_disabled"]' => ['checked' => TRUE], + ], + 'required' => [ + ':input[name="toggle_required"]' => ['checked' => TRUE], + ], + ], + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => $this->t('Save'), + ); + + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + + } + +}