Closed (duplicate)
Project:
H5P - Create and Share Rich Content and Applications
Version:
2.0.0-alpha3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2023 at 11:24 UTC
Updated:
26 Oct 2023 at 14:16 UTC
Jump to comment: Most recent
Comments
Comment #2
andrewjaykirkpatrick commentedThanks for the .once code change.
I can confirm this works for me in Drupal 10.0.3 with PHP8.
I cannot edit new H5P interactive items due to a reliance on CKEditor3 as defined in /vendor/h5p/h5p-editor/h5peditor.class.php
'ckeditor/ckeditor.js'.
I also noted a small issue with json decoded values being null rather than empty (single quotes) in /src/Entity/H5PContent.php
- 'authors' => json_decode($this->get('authors')->value),
+ 'authors' => json_decode($this->get('authors')->value ?: ''),
- 'changes' => json_decode($this->get('changes')->value),
+ 'changes' => json_decode($this->get('changes')->value ?: ''),
Comment #5
pjotr.savitski commentedIt might be better to use the
for FinishedEvent class as that would work with both Drupal 9 and 10.
Comment #6
pjotr.savitski commentedI'm not yet 100% sure, but inability to use interactive items might have everything to do with removal of the calls to jquery.once and not replacing those with the new custom once that is available in both versions 9 and 10.
H5P is not using the default CKEditor added by Drupal, but a custom one that is shipped with the h5p-editor dependency. This is why ckeditor/ckeditor.js is a false positive and irrelevant to the upgrade process.
I've currently refactored the code in application.js file to use the new logic and the code looks like this (please note that I've replaced this with element in all the relevant places; I've edited and included the whole file):
The editor seems to be working just fine for me, although I'm still on Drupal 9.5.x and can't determine if it also works with the latest release of version 10. NB! Please notice that h5peditor library will need a dependency of core/once to be added.
Comment #7
ammaletu commentedThere seem to be two Merge Requests trying to make H5P ready for Drupal 10. This one, and the one in https://www.drupal.org/project/h5p/issues/3329297. Would it make sense to combine the two? Or better to simply get one of them ready and then see about cleaning up the other one? The other MR has at least one patch which is missing here (see comment #14 in the other ticket).
Is there anything I can do to move this along? We want to upgrade to Drupal 10 in a few days, and now I see that we can't without heavily patching this module. End-of-life for Drupal 9 is in 8 days! Please let me know what the next step would be. Incorporating Pjotr's comments into the MR?
Comment #8
catchClosing this as duplicate of #3329297: Automated Drupal 10 compatibility fixes, please focus any efforts over there.