Issue #2528482 by googletorp, mpdonadio, TR: Fix notice in Date::processDate

8.0.x
Alex Pott 2015-08-06 13:33:32 +01:00
parent 6b4e86d4a8
commit 9f6d914493
3 changed files with 12 additions and 1 deletions

View File

@ -40,6 +40,8 @@ class Date extends FormElement {
'#process' => [[$class, 'processDate']],
'#pre_render' => [[$class, 'preRenderDate']],
'#theme_wrappers' => ['form_element'],
'#attributes' => ['type' => 'date'],
'#date_date_format' => 'Y-m-d',
];
}

View File

@ -533,7 +533,7 @@ class FormTest extends WebTestBase {
// All the elements should be marked as disabled, including the ones below
// the disabled container.
$actual_count = count($disabled_elements);
$expected_count = 41;
$expected_count = 42;
$this->assertEqual($actual_count, $expected_count, SafeMarkup::format('Found @actual elements with disabled property (expected @expected).', array(
'@actual' => count($disabled_elements),
'@expected' => $expected_count,

View File

@ -142,6 +142,15 @@ class FormTestDisabledElementsForm extends FormBase {
'#date_timezone' => 'Europe/Berlin',
);
$form['disabled_container']['disabled_container_date'] = array(
'#type' => 'date',
'#title' => 'date',
'#default_value' => '2001-01-13',
'#expected_value' => '2001-01-13',
'#test_hijack_value' => '2013-01-01',
'#date_timezone' => 'Europe/Berlin',
);
// Try to hijack the email field with a valid email.
$form['disabled_container']['disabled_container_email'] = array(