diff --git a/h5p/classes/framework.php b/h5p/classes/framework.php index 286f16fa9a3..4524f0af059 100644 --- a/h5p/classes/framework.php +++ b/h5p/classes/framework.php @@ -1265,6 +1265,10 @@ class framework implements \H5PFrameworkInterface { * Get stored setting. * Implements getOption. * + * To avoid updating the cache libraries when using the Hub selector, + * {@link \H5PEditorAjax::isContentTypeCacheUpdated}, the setting content_type_cache_updated_at + * always return the current time. + * * @param string $name Identifier for the setting * @param string $default Optional default value if settings is not set * @return mixed Return Whatever has been stored as the setting @@ -1277,6 +1281,11 @@ class framework implements \H5PFrameworkInterface { return \H5PDisplayOptionBehaviour::CONTROLLED_BY_AUTHOR_DEFAULT_OFF; } + // To avoid update the libraries cache using the Hub selector. + if ($name == 'content_type_cache_updated_at') { + return time(); + } + $value = get_config('core_h5p', $name); if ($value === false) { return $default; diff --git a/h5p/h5plib/v124/joubel/editor/readme_moodle.txt b/h5p/h5plib/v124/joubel/editor/readme_moodle.txt index 43f07d352e8..34f3c9f6454 100644 --- a/h5p/h5plib/v124/joubel/editor/readme_moodle.txt +++ b/h5p/h5plib/v124/joubel/editor/readme_moodle.txt @@ -6,6 +6,8 @@ Downloaded last release from: https://github.com/h5p/h5p-editor-php-library/rele Import procedure: - Copy all the files from the folder repository in this directory. +- In the method ns.LibrarySelector.prototype.appendTo (scripts/h5peditor-library-selector.js), + comment the line "this.$selector.appendTo($element);" to avoid the display of the Hub Selector. Removed: * composer.json diff --git a/h5p/h5plib/v124/joubel/editor/scripts/h5peditor-library-selector.js b/h5p/h5plib/v124/joubel/editor/scripts/h5peditor-library-selector.js index 2d4a02ce95b..877fb462720 100644 --- a/h5p/h5plib/v124/joubel/editor/scripts/h5peditor-library-selector.js +++ b/h5p/h5plib/v124/joubel/editor/scripts/h5peditor-library-selector.js @@ -129,7 +129,13 @@ ns.LibrarySelector.prototype.appendTo = function ($element) { var self = this; this.$parent = $element; - this.$selector.appendTo($element); + /* + Start Moodle change + This line is commented out to prevent display of the hub selector in Moodle. + For more information see MDL-67814 + */ + //this.$selector.appendTo($element); + /* End Moodle change */ this.$tutorialUrl.appendTo($element); this.$exampleUrl.appendTo($element);