Skip to content
Snippets Groups Projects
Commit 466f6932 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #755566 by effulgentsia: use of ID within theme_filter_guidelines()...

- Patch #755566 by effulgentsia: use of ID within theme_filter_guidelines() breaks HTML validation with more than 1 field item on a page.
parent 1883b535
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -12,7 +12,7 @@ Drupal.behaviors.filterGuidelines = {
.bind('change', function () {
$(this).parents('.filter-wrapper')
.find('.filter-guidelines-item').hide()
.siblings('#filter-guidelines-' + this.value).show();
.siblings('.filter-guidelines-' + this.value).show();
})
.change();
}
......
......@@ -1122,7 +1122,9 @@ function theme_filter_guidelines($variables) {
$format = $variables['format'];
$name = isset($format->name) ? '<label>' . $format->name . ':</label>' : '';
return '<div id="filter-guidelines-' . $format->format . '" class="filter-guidelines-item">' . $name . theme('filter_tips', array('tips' => _filter_tips($format->format, FALSE))) . '</div>';
$attributes['class'][] = 'filter-guidelines-item';
$attributes['class'][] = 'filter-guidelines-' . $format->format;
return '<div' . drupal_attributes($attributes) . '>' . $name . theme('filter_tips', array('tips' => _filter_tips($format->format, FALSE))) . '</div>';
}
/**
......
......@@ -268,9 +268,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase {
$this->assert(count($this->xpath($field_xpath . $field_items_xpath_suffix)) == 1, t('Found the correct number of field items on the initial page.'));
$this->assertFieldByXPath($field_xpath . $button_xpath_suffix, NULL, t('Found the "add more" button on the initial page.'));
}
// @todo Legacy bug of duplicate ids for filter-guidelines-FORMAT. See
// http://drupal.org/node/755566.
$this->assertNoDuplicateIds(t('Initial page contains unique IDs'), 'Other', array('filter-guidelines-1', 'filter-guidelines-2', 'filter-guidelines-3'));
$this->assertNoDuplicateIds(t('Initial page contains unique IDs'), 'Other');
// Submit the "add more" button of each form twice. After each corresponding
// page update, ensure the same as above. To successfully implement
......@@ -286,9 +284,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase {
$settings = array_merge_recursive($settings, $commands[0]['settings']);
$this->assert(count($this->xpath($field_xpath . $field_items_xpath_suffix)) == $i+2, t('Found the correct number of field items after an AJAX submission.'));
$this->assertFieldByXPath($field_xpath . $button_xpath_suffix, NULL, t('Found the "add more" button after an AJAX submission.'));
// @todo Legacy bug of duplicate ids for filter-guidelines-FORMAT. See
// http://drupal.org/node/755566.
$this->assertNoDuplicateIds(t('Updated page contains unique IDs'), 'Other', array('filter-guidelines-1', 'filter-guidelines-2', 'filter-guidelines-3'));
$this->assertNoDuplicateIds(t('Updated page contains unique IDs'), 'Other');
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment