mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Merge branch 'MDL-60752-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
bef5a8ca10
@ -85,10 +85,20 @@ class moodle1_mod_lti_handler extends moodle1_mod_handler {
|
||||
|
||||
$ignorefields = array('id', 'modtype');
|
||||
if (!$DB->record_exists('lti_types', array('id' => $data['typeid']))) {
|
||||
$ntypeid = $DB->get_field('lti_types_config',
|
||||
'typeid',
|
||||
array('name' => 'toolurl', 'value' => $data['toolurl']),
|
||||
IGNORE_MULTIPLE);
|
||||
$ntypeid = false;
|
||||
$toolurls = $DB->get_records_select(
|
||||
'lti_types_config',
|
||||
"name = 'toolurl' AND " . $DB->sql_compare_text('value', 256) . ' = ' . $DB->sql_compare_text('?', 256),
|
||||
[$data['toolurl']],
|
||||
'',
|
||||
'id, value'
|
||||
);
|
||||
foreach ($toolurls as $id => $value) {
|
||||
if ($value == $data['toolurl']) {
|
||||
$ntypeid = $id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($ntypeid === false) {
|
||||
$ntypeid = $DB->get_field('lti_types_config',
|
||||
'typeid',
|
||||
|
Loading…
x
Reference in New Issue
Block a user