MDL-50484 lib_formslib: Persistant input should have different id

Persistant input is appended for frozen elements
and should have different id then the actual element
This commit is contained in:
Rajesh Taneja 2016-02-05 13:59:26 +08:00
parent 2aacd415e1
commit 1ebda3eb8c
7 changed files with 83 additions and 5 deletions

View file

@ -254,11 +254,18 @@ class HTML_QuickForm_element extends HTML_Common
return '';
} else {
$id = $this->getAttribute('id');
if (isset($id)) {
// Id of persistant input is different then the actual input.
$id = array('id' => $id . '_persistant');
} else {
$id = array();
}
return '<input' . $this->_getAttrString(array(
'type' => 'hidden',
'name' => $this->getName(),
'value' => $this->getValue()
) + (isset($id)? array('id' => $id): array())) . ' />';
) + $id) . ' />';
}
}
@ -486,4 +493,4 @@ class HTML_QuickForm_element extends HTML_Common
// }}}
} // end class HTML_QuickForm_element
?>
?>

View file

@ -30,6 +30,7 @@ MDL-46467 - $mform->hardfreeze causes labels to loose their for HTML attribute
MDL-52081 - made all constructors PHP7 compatible
MDL-52826 - Remove onsubmit events pointing to the global validation functions and script
tag moved after the HTML
MDL-50484 - _getPersistantData() returns id with _persistant prefixed to element id.
Pear