Merge branch 'MDL-77834-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE

This commit is contained in:
Sara Arjona 2024-07-09 15:22:13 +02:00
commit a10c074f54
No known key found for this signature in database
2 changed files with 3 additions and 7 deletions

View File

@ -301,10 +301,6 @@ class mod_feedback_complete_form extends moodleform {
} else { } else {
// Add non-group element to the form. // Add non-group element to the form.
if (is_array($element)) { if (is_array($element)) {
if ($this->is_frozen() && $element[0] === 'text') {
// Convert 'text' element to 'static' when freezing for better display.
$element = ['static', $element[1], $element[2]];
}
$element = call_user_func_array(array($this->_form, 'createElement'), $element); $element = call_user_func_array(array($this->_form, 'createElement'), $element);
} }
$element = $this->_form->addElement($element); $element = $this->_form->addElement($element);
@ -323,7 +319,7 @@ class mod_feedback_complete_form extends moodleform {
// Set default value. // Set default value.
if ($setdefaultvalue && ($tmpvalue = $this->get_item_value($item))) { if ($setdefaultvalue && ($tmpvalue = $this->get_item_value($item))) {
$this->_form->setDefault($element->getName(), s($tmpvalue)); $this->_form->setDefault($element->getName(), htmlspecialchars_decode($tmpvalue, ENT_QUOTES));
} }
// Freeze if needed. // Freeze if needed.

View File

@ -251,8 +251,8 @@ Feature: Anonymous feedback
And I should see "Non anonymous entries (1)" And I should see "Non anonymous entries (1)"
And I click on "," "link" in the "Username 1" "table_row" And I click on "," "link" in the "Username 1" "table_row"
And I should see "(Username 1)" And I should see "(Username 1)"
And I should see "usertext" Then the field "this is a short text answer" matches value "usertext"
And I navigate to "Responses" in current page administration And I navigate to "Responses" in current page administration
And I follow "Response number: 1" And I follow "Response number: 1"
And I should see "Response number: 1 (Anonymous)" And I should see "Response number: 1 (Anonymous)"
Then I should see "anontext" And the field "this is a short text answer" matches value "anontext"