Merge branch 'MDL-79440-master' of https://github.com/snake/moodle

This commit is contained in:
Huong Nguyen
2023-09-25 14:56:49 +07:00
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -437,7 +437,9 @@ class mod_lti_edit_types_form extends moodleform {
// change to the existing value. Add the option as a disabled to make this clear. Once changed, it cannot be set again.
// This isn't supported from 4.3 onward in the creation of new tool types.
foreach (['lti_sendname', 'lti_sendemailaddr'] as $elementname) {
if ($this->_form->_defaultValues[$elementname] == LTI_SETTING_DELEGATE) {
if (!empty($this->_form->_defaultValues[$elementname])
&& $this->_form->_defaultValues[$elementname] == LTI_SETTING_DELEGATE) {
$elementarr = array_filter($this->_form->_elements, function ($element) use($elementname) {
return !empty($element->_attributes['name']) && $element->_attributes['name'] == $elementname;
});
+1 -1
View File
@@ -473,7 +473,7 @@ class mod_lti_mod_form extends moodleform_mod {
$mform->setType('secureicon', PARAM_URL);
// Add standard course module grading elements, and show them if the tool type + instance config permits it.
if (in_array($config['acceptgrades'], [LTI_SETTING_ALWAYS, LTI_SETTING_DELEGATE])) {
if (!empty($config['acceptgrades']) && in_array($config['acceptgrades'], [LTI_SETTING_ALWAYS, LTI_SETTING_DELEGATE])) {
$elementnamesbeforegrading = $this->_form->_elementIndex;
$this->standard_grading_coursemodule_elements();
$elementnamesaftergrading = $this->_form->_elementIndex;