- Issue created by @anschinsan
- πΊπΈUnited States andrewjaykirkpatrick Oregon
Thanks 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 ?: ''), - First commit to issue fork.
- @omar_emailat opened merge request.
- πͺπͺEstonia pjotr.savitski
It might be better to use the
use Drupal\Component\EventDispatcher\Event;
for FinishedEvent class as that would work with both Drupal 9 and 10.
- πͺπͺEstonia pjotr.savitski
I'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 detachment code looks like this (I'm not including the longer one from attachment function):
detach: function (context, settings, trigger) { if (trigger === 'serialize') { once('H5PEditor', '.h5p-editor-iframe', context).forEach(function(element) { for (var i = 0; i < submitHandlers.length; i++) { if (submitHandlers[i].element === element) { // Trigger submit handler submitHandlers[i].handler(); } } }); } }
- π©πͺGermany ammaletu Bonn, Germany
There 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 π Automated Drupal 10 compatibility fixes Needs review . 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?
- Status changed to Closed: duplicate
about 1 year ago 2:16pm 26 October 2023 - π¬π§United Kingdom catch
Closing this as duplicate of π Automated Drupal 10 compatibility fixes Needs review , please focus any efforts over there.