mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-79440 mod_lti: fix missing array key warning on LTI 2 edit
These fields only exist for LTI 1.1 and LTI 1.3 edits, so can be ignored in LTI 2.0 edits. This change fixes this for the tool type edit (edit_form) and for the tool instance form (mod_form).
This commit is contained in:
parent
ecddfa6ccd
commit
72e867f9e6
@ -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;
|
||||
});
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user