mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'm24_MDL-36142_Incorrect_query_returns_HTTP_404' of https://github.com/scara/moodle
This commit is contained in:
commit
109473368d
@ -79,7 +79,11 @@ if (!empty($scoid)) {
|
||||
if ($sco = scorm_get_sco($scoid)) {
|
||||
if ($sco->launch == '') {
|
||||
// Search for the next launchable sco
|
||||
if ($scoes = $DB->get_records_select('scorm_scoes', "scorm = ? AND '.$DB->sql_isnotempty('scorm_scoes', 'launch', false, true).' AND id > ?", array($scorm->id, $sco->id), 'id ASC')) {
|
||||
if ($scoes = $DB->get_records_select(
|
||||
'scorm_scoes',
|
||||
'scorm = ? AND '.$DB->sql_isnotempty('scorm_scoes', 'launch', false, true).' AND id > ?',
|
||||
array($scorm->id, $sco->id),
|
||||
'id ASC')) {
|
||||
$sco = current($scoes);
|
||||
}
|
||||
}
|
||||
@ -89,7 +93,12 @@ if (!empty($scoid)) {
|
||||
// If no sco was found get the first of SCORM package
|
||||
//
|
||||
if (!isset($sco)) {
|
||||
$scoes = $DB->get_records_select('scorm_scoes', "scorm = ? AND ".$DB->sql_isnotempty('scorm_scoes', 'launch', false, true), array($scorm->id), 'id ASC');
|
||||
$scoes = $DB->get_records_select(
|
||||
'scorm_scoes',
|
||||
'scorm = ? AND '.$DB->sql_isnotempty('scorm_scoes', 'launch', false, true),
|
||||
array($scorm->id),
|
||||
'id ASC'
|
||||
);
|
||||
$sco = current($scoes);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user