mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-60752 lti: Compare text in types_config properly
This commit is contained in:
parent
7a571b813a
commit
f169f4fd21
1 changed files with 14 additions and 4 deletions
|
@ -85,10 +85,20 @@ class moodle1_mod_lti_handler extends moodle1_mod_handler {
|
||||||
|
|
||||||
$ignorefields = array('id', 'modtype');
|
$ignorefields = array('id', 'modtype');
|
||||||
if (!$DB->record_exists('lti_types', array('id' => $data['typeid']))) {
|
if (!$DB->record_exists('lti_types', array('id' => $data['typeid']))) {
|
||||||
$ntypeid = $DB->get_field('lti_types_config',
|
$ntypeid = false;
|
||||||
'typeid',
|
$toolurls = $DB->get_records_select(
|
||||||
array('name' => 'toolurl', 'value' => $data['toolurl']),
|
'lti_types_config',
|
||||||
IGNORE_MULTIPLE);
|
"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) {
|
if ($ntypeid === false) {
|
||||||
$ntypeid = $DB->get_field('lti_types_config',
|
$ntypeid = $DB->get_field('lti_types_config',
|
||||||
'typeid',
|
'typeid',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue