Skip to content

Commit

Permalink
Merge branch 'MDL-60752-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Nov 9, 2017
2 parents 4f3262f + f169f4f commit bef5a8c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions mod/lti/backup/moodle1/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,20 @@ public function process_basiclti($data) {

$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',
Expand Down

0 comments on commit bef5a8c

Please sign in to comment.