Commit 959fa9da authored by webchick's avatar webchick

Revert "Issue #2160365 by plopesc, vijaycs85: Date field required marker rendered as "Array"."

Broke HEAD.

This reverts commit 0f0edea2.
parent 86ae96e4
...@@ -227,11 +227,13 @@ function template_preprocess_datetime_wrapper(&$variables) { ...@@ -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;
'#theme' => 'form_required_marker', if(!empty($element['#required'])) {
'#element' => $element, $variables['required'] = array(
); '#theme' => 'form_required_marker',
$variables['required'] = !empty($element['#required']) ? drupal_render($form_required_marker) : ''; '#element' => $element,
);
}
if (!empty($element['#title'])) { if (!empty($element['#title'])) {
$variables['title'] = $element['#title']; $variables['title'] = $element['#title'];
......
...@@ -69,7 +69,6 @@ function setUp() { ...@@ -69,7 +69,6 @@ function setUp() {
'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 @@ function testDateField() { ...@@ -98,7 +97,6 @@ function testDateField() {
// 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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment