MDL-46467 forms: Labels have "for" attribute even when frozen

This commit is contained in:
Brian Barnes 2015-01-27 14:30:22 +13:00
parent e0ae3519a1
commit 8b5f402151
2 changed files with 2 additions and 1 deletions

View File

@ -186,7 +186,7 @@ class HTML_QuickForm_Renderer_Tableless extends HTML_QuickForm_Renderer_Default
} else {
$id = $element->getName();
}
if (!empty($id) and !$element->isFrozen() and !is_a($element, 'MoodleQuickForm_group') and !is_a($element, 'HTML_QuickForm_static')) { // moodle hack
if (!empty($id) and !is_a($element, 'MoodleQuickForm_group') and !is_a($element, 'HTML_QuickForm_static')) { // moodle hack
$html = str_replace('<label', '<label for="' . $id . '"', $html);
$element_html = preg_replace('#name="' . $id . '#',
'id="' . $id . '" name="' . $id . '',

View File

@ -21,3 +21,4 @@ Most probably we will stop using this library in the future.
MDL-20876 - replaced split() with explode() or preg_split() where appropriate
MDL-40267 - Moodle core_text strlen functions used for range rule rule to be utf8 safe.
MDL-46467 - $mform->hardfreeze causes labels to loose their for HTML attribute