Skip to content

Commit

Permalink
MDL-69331 core_h5p: Only upgrade enabled libraries
Browse files Browse the repository at this point in the history
The core\task\h5p_get_content_types_task task will only download
content-type for enabled libraries.
  • Loading branch information
sarjona committed Apr 15, 2021
1 parent 5308ba0 commit dbfd4ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions h5p/classes/core.php
Expand Up @@ -179,6 +179,11 @@ public function fetch_latest_content_types(): ?\stdClass {
$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;
Expand Down

0 comments on commit dbfd4ae

Please sign in to comment.