Skip to content

GH #3162: CA: Transfer content type machine name and title. Hub: Option and commands to switch between using content type machine name or title#3200

Merged
chrieinv merged 4 commits intomasterfrom
3162-naming-of-content-types-in-edlib
Oct 30, 2025
Merged

GH #3162: CA: Transfer content type machine name and title. Hub: Option and commands to switch between using content type machine name or title#3200
chrieinv merged 4 commits intomasterfrom
3162-naming-of-content-types-in-edlib

Conversation

@chrieinv
Copy link
Contributor

@chrieinv chrieinv commented Oct 29, 2025

Adds configuration and commands to switch between displaying H5P Content type machine name or H5P Content type title as Content type in the Hub. Both values are transferred from CA and stored in the Hub as Tags that are connected to the content version.

The Content type is displayed on the content details page and on the Explore and My content listings and filter.

1. Config setting in Hub

Update Hub environment settings and add FEATURE_CA_CONTENT_TYPE_DISPLAY with value h5p (default) to use Content Type machine name, or h5p_title to use Content type title. Use the artisan command edlib:h5p-displayname to check that the configured value is correct.
This will take effect immediately for new content versions.

2. Get title for existing machine names

This is a one time update to get the title for existing content type machines. Run the Artisan command edlib:h5p-attach-content-type-title. Select the LTI Tool to fetch the titles from. This will only get the titles for content types connected to the selected LTI Tool. The titles are created as Tags and will be connected to the content versions connected to the LTI Tool.
There is no visible change.

3. Update existing content

The artisan command edlib:h5p-displayname displays the current configured, adding option --migrate will update the fields displayed_content_type and displayed_content_type_normalized with the name from the Tag with prefix h5 or h5p_title depending on the configuration. Any content that does not have tags with prefix h5p or h5p_title will have null in these fields, thus displaying the LTI Tool name as content type.
The change in visible on content version details page.

To update the listings and filter values Meilisearch must re-index the data, use the artisan command edlib:search-index-rebuild. Listings and filter should now display the updated values.

Caution

Listings and search will not display any data during the re-indexing

Switching back (and forth)

  1. Update the environment configuration FEATURE_CA_CONTENT_TYPE_DISPLAY
  2. Run the artisan command edlib:h5p-displayname and verify that it's correct
  3. Run artisan command edlib:h5p-displayname --migrate to update all content versions with new value
  4. Run artisan command edlib:search-index-rebuild to rebuild the Meilisearch index

…on and commands to switch between using content type machine name or title
@chrieinv chrieinv linked an issue Oct 29, 2025 that may be closed by this pull request
@github-actions github-actions bot added Component: Content Author All issues that affect content author (sourcecode/apis/contentauthor) Component: Hub The core of Edlib - handling search, filtering, my content and shared content labels Oct 29, 2025
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 2.90698% with 167 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.09%. Comparing base (100802f) to head (c20914b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3200      +/-   ##
============================================
- Coverage     64.17%   63.09%   -1.08%     
- Complexity     3345     3376      +31     
============================================
  Files           391      396       +5     
  Lines         14581    14320     -261     
============================================
- Hits           9357     9035     -322     
- Misses         5224     5285      +61     
Components Coverage Δ
Content Author 69.08% <15.15%> (-0.54%) ⬇️
Hub 44.29% <0.00%> (-1.75%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chrieinv
Copy link
Contributor Author

Test failures are most likely caused by not using the updated php-edlib-resource-kit

@github-actions github-actions bot added dependencies Pull requests that update a dependency file composer Pull requests that update Composer packages labels Oct 30, 2025
@chrieinv chrieinv merged commit 127e299 into master Oct 30, 2025
9 of 11 checks passed
@chrieinv chrieinv deleted the 3162-naming-of-content-types-in-edlib branch October 30, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Content Author All issues that affect content author (sourcecode/apis/contentauthor) Component: Hub The core of Edlib - handling search, filtering, my content and shared content composer Pull requests that update Composer packages dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Naming of content types in Edlib

2 participants