Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[media] fixes issue when media module try to instantiate a non existing instrument. #8903

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions modules/media/php/mediafileprovisioner.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,19 @@ class MediaFileProvisioner extends \LORIS\Data\Provisioners\DBRowProvisioner

// make sure not to call the factory when $testname is null or ''
if (!empty($testname) && !isset($this->_instrumentnames[$testname])) {
$this->_instrumentnames[$testname] = \NDB_BVL_Instrument::factory(
$this->lorisinstance,
$testname,
)->getFullname();
try {
$this->_instrumentnames[$testname] = \NDB_BVL_Instrument::factory(
$this->lorisinstance,
$testname,
)->getFullname();
} catch (\Exception $e) {
error_log(
"There was a problem instantiating the instrument ".
"'$testname'. Make sure the instrument is valid and ".
"functional in order for it to be displayed in the media ".
"module."
);
}
}
$row['fullName'] = $this->_instrumentnames[$testname] ?? null;

Expand Down