- Issue created by @SirClickALot
- π©πͺGermany filburt
Hi,
you could try the following - worked for me:
function custom_h5p_overrides_h5p_styles_alter(array &$styles, array $libraries, string $mode): void {
...
} Have the same issue in both 2.0.0-alpha5 and 2.0.0-alpha6. #2 did not work for me.
Debugging shows that the hook is not being called. Worked in D10 alpha4.- π¬π§United Kingdom SirClickALot Somerset
@anzi31, Agreed, the hook is simply not being called and #2 could not really make any difference.
We do love H5P for educational project but forward-compatibility of this module just does not seem to me to be going to happen so we are finding ourselves look around for other alternatives.
Looks like \Drupal::moduleHandler()->alter() was removed from H5PDefaultFormatter.php.
If you embed a quiz, it works, but if it is an iframe, it does not.- πΊπΈUnited States illeace
What I found using Drupal 11 and 2.0.0-alpha6 is that my H5P CSS customizations worked when viewing the H5P embed link, and also were visible when editing the H5P, but not when viewing the node directly. After applying this patch, I also see those CSS customizations when viewing the node. I'm marking this RTBC.
- Merge request !35HFP-2184 Added missing metadata to content upgrade process β (Merged) created by sim_1
- πΊπΈUnited States sim_1
Merged and marking as fixed. Thanks everyone for working on this and testing!
Automatically closed - issue fixed for 2 weeks with no activity.
- πͺπͺEstonia pjotr.savitski
I could be wrong as I haven't tried using the code yet, but it somehow seems that only the first script and style would be added by the
$jsFilePaths[] = $aggregatedJS['scripts'][0][0];
and
$cssFilePaths[] = $aggregatedCSS['styles'][0][0];
Alter hooks could potentially add multiple scripts/styles and the solution should probably use array merge to add all the scripts/styles to existing ones.
- πΊπΈUnited States sim_1
Thank you so much, @pjotr.savitski for finding that issue. Reopening for testing.
- Merge request !47Issue #3526331: Fix to allow multiple H5P CSS/JS alter files β (Merged) created by Unnamed author
- πΊπΈUnited States illeace
I've review the patch from @pjotr.savitski and confirmed:
- Prior to the patch, when viewing a node with an H5P or editing an H5P, the first CSS/JS alter file was included, but not the 2nd or 3rd.
- After the patch, additional alter files beyond the first are correctly included.
- Note: this change does not affect the embed method of viewing an H5P, which continues to work correctly.
I've created a new feature branch / MR in the Issue fork, which is ready to merge.
-
sim_1 β
committed 1bef71c6 on 2.0.x authored by
illeace β
[#3526331] fix: Can no longer insert / override CSS since update to 2.0....
-
sim_1 β
committed 1bef71c6 on 2.0.x authored by
illeace β
- πΊπΈUnited States sim_1
Great, thanks! Merged second MR and re-marking as fixed.
Now that this issue is closed, please review the contribution record.
As a contributor, attribute any organization helped you, or if you volunteered your own time.
Maintainers, please credit people who helped resolve this issue.