mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-74895 h5p: more resilient error handling during content fetching.
On new installs, the task for downloading new H5P content types would throw exceptions and exit when encountering unexpected and/or missing data.
This commit is contained in:
parent
4ce642e8ba
commit
426f533c07
@ -277,7 +277,13 @@ class core extends H5PCore {
|
||||
$file->delete();
|
||||
|
||||
$librarykey = static::libraryToString($library);
|
||||
$libraryid = $factory->get_storage()->h5pC->librariesJsonData[$librarykey]["libraryId"];
|
||||
|
||||
$libraryjson = $factory->get_storage()->h5pC->librariesJsonData[$librarykey];
|
||||
if (!array_key_exists('libraryId', $libraryjson)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$libraryid = $libraryjson['libraryId'];
|
||||
|
||||
// Update example and tutorial (if any of them are defined in $library).
|
||||
$params = ['id' => $libraryid];
|
||||
|
Loading…
x
Reference in New Issue
Block a user