MDL-69331 core_h5p: Only upgrade enabled libraries

The core\task\h5p_get_content_types_task task will only download
content-type for enabled libraries.
This commit is contained in:
Sara Arjona
2021-04-15 09:03:56 +02:00
parent 5308ba0947
commit dbfd4aebb5
+5
View File
@@ -179,6 +179,11 @@ class core extends \H5PCore {
$framework = $factory->get_framework();
foreach ($contenttypes->contentTypes as $type) {
// Don't fetch content types if any of the versions is disabled.
$librarydata = (object) ['machinename' => $type->id];
if (!api::is_library_enabled($librarydata)) {
continue;
}
// Don't fetch content types that require a higher H5P core API version.
if (!$this->is_required_core_api($type->coreApiVersionNeeded)) {
continue;