MDL-78617 formslib: Fix element with no name going to sticky footer.

This commit is contained in:
Ilya Tregubov 2023-06-30 10:03:37 +08:00
parent 8dbb6183ff
commit 21ab60b30b
No known key found for this signature in database
GPG Key ID: 0F58186F748E55C1

View File

@ -3267,7 +3267,7 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
}
$this->_templates[$group->getName()] = $html;
// Check if the element should be displayed in the sticky footer.
if ($this->_stickyfooterelement == $group->getName()) {
if ($group->getName() && ($this->_stickyfooterelement == $group->getName())) {
$stickyfooter = new core\output\sticky_footer($html);
$html = $OUTPUT->render($stickyfooter);
}
@ -3353,7 +3353,7 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
}
// Check if the element should be displayed in the sticky footer.
if ($this->_stickyfooterelement == $element->getName()) {
if ($element->getName() && ($this->_stickyfooterelement == $element->getName())) {
$stickyfooter = new core\output\sticky_footer($html);
$html = $OUTPUT->render($stickyfooter);
}