Issue #3546467: Add H5P Content Hub searching to H5P Editor
Summary
Implements Content Hub metadata caching and enables searching/downloading shared content from the H5P Hub. The changes add the necessary database schema, configuration options, and API endpoints to support Content Hub integration.
Issues
Closes #3546467
Changes Made
-
Database Schema: Added
h5p_content_hub_metadata_cache
table to store cached hub metadata by language- Added update hook
h5p_update_8006()
to create the new cache table
- Added update hook
-
Admin Interface/Configuration: Added checkbox to control Content Hub search functionality (disabled when H5P Hub is disabled)
- Added
h5p_search_content_hub
setting to enable/disable shared content search
- Added
- Frontend Integration: Updated JavaScript to pass Content Hub settings and search URL to the H5P editor
- API Endpoints: Implemented Content Hub metadata cache methods and hub content retrieval
- Updated the
fetchExternalData()
function so it returns information in the expected format when the$fullData
paramter isTRUE
.
Known Limitations
- The content hub metadata caching could likely use Drupal's page cache rather that implement a one-off cache. In this case I ported the D7 implemenation rather than refactor it.
Testing
-
Database schema creation works correctly on module update -
Admin settings form properly enables/disables Content Hub search based on H5P Hub status. - Visit
/admin/config/system/h5p
and ensure the "Enable shared content in H5P Hub" option is checked. - Create a new H5P with a field that uses the H5P Hub Editor
- In editor, click the "Get Shared Content" radio button.
- Verify that you can search and filter the content
- Choose an H5P and verify that it properly downloads
- Save the H5P and verify you can view/interact with it.
- Visit
-
Admin setting is included with config import and export. -
Content Hub metadata caching functions store and retrieve data correctly
Edited by Greg Watson