Revert "Issue #2160365 by plopesc, vijaycs85: Date field required marker rendered as "Array"."
Broke HEAD.
This reverts commit 0f0edea2a3
.
8.0.x
parent
86ae96e4fd
commit
959fa9daa5
|
@ -227,11 +227,13 @@ function template_preprocess_datetime_wrapper(&$variables) {
|
||||||
$element = $variables['element'];
|
$element = $variables['element'];
|
||||||
|
|
||||||
// If the element is required, a required marker is appended to the label.
|
// If the element is required, a required marker is appended to the label.
|
||||||
$form_required_marker = array(
|
$variables['required'] = NULL;
|
||||||
|
if(!empty($element['#required'])) {
|
||||||
|
$variables['required'] = array(
|
||||||
'#theme' => 'form_required_marker',
|
'#theme' => 'form_required_marker',
|
||||||
'#element' => $element,
|
'#element' => $element,
|
||||||
);
|
);
|
||||||
$variables['required'] = !empty($element['#required']) ? drupal_render($form_required_marker) : '';
|
}
|
||||||
|
|
||||||
if (!empty($element['#title'])) {
|
if (!empty($element['#title'])) {
|
||||||
$variables['title'] = $element['#title'];
|
$variables['title'] = $element['#title'];
|
||||||
|
|
|
@ -69,7 +69,6 @@ class DateTimeFieldTest extends WebTestBase {
|
||||||
'field_name' => $this->field->name,
|
'field_name' => $this->field->name,
|
||||||
'entity_type' => 'entity_test',
|
'entity_type' => 'entity_test',
|
||||||
'bundle' => 'entity_test',
|
'bundle' => 'entity_test',
|
||||||
'required' => TRUE,
|
|
||||||
));
|
));
|
||||||
$this->instance->save();
|
$this->instance->save();
|
||||||
|
|
||||||
|
@ -98,7 +97,6 @@ class DateTimeFieldTest extends WebTestBase {
|
||||||
// Display creation form.
|
// Display creation form.
|
||||||
$this->drupalGet('entity_test/add');
|
$this->drupalGet('entity_test/add');
|
||||||
$this->assertFieldByName("{$field_name}[0][value][date]", '', 'Date element found.');
|
$this->assertFieldByName("{$field_name}[0][value][date]", '', 'Date element found.');
|
||||||
$this->assertFieldByXPath('//*[@id="' . $field_name . '-add-more-wrapper"]/h4/span', '*', 'Required markup found');
|
|
||||||
$this->assertNoFieldByName("{$field_name}[0][value][time]", '', 'Time element not found.');
|
$this->assertNoFieldByName("{$field_name}[0][value][time]", '', 'Time element not found.');
|
||||||
|
|
||||||
// Submit a valid date and ensure it is accepted.
|
// Submit a valid date and ensure it is accepted.
|
||||||
|
|
Loading…
Reference in New Issue