Problem/Motivation
Following with Drupal 11 requirements there should be php8.3 and higher.
After setting this php version we've got deprecation warnings about dynamic properties in a class:
Deprecated function: Creation of dynamic property H5PCore::$url is deprecated in H5PCore->__construct() (line 2073 of modules/contrib/h5p/vendor/h5p/h5p-core/h5p.classes.php).
Deprecated function: Creation of dynamic property H5PCore::$development_mode is deprecated in H5PCore->__construct() (line 2075 of modules/contrib/h5p/vendor/h5p/h5p-core/h5p.classes.php).
Deprecated function: Creation of dynamic property H5PCore::$aggregateAssets is deprecated in H5PCore->__construct() (line 2077 of modules/contrib/h5p/vendor/h5p/h5p-core/h5p.classes.php).
Deprecated function: Creation of dynamic property H5PCore::$fullPluginPath is deprecated in H5PCore->__construct() (line 2080 of modules/contrib/h5p/vendor/h5p/h5p-core/h5p.classes.php).
Deprecated function: Creation of dynamic property H5PCore::$relativePathRegExp is deprecated in H5PCore->__construct() (line 2083 of modules/contrib/h5p/vendor/h5p/h5p-core/h5p.classes.php).
Steps to reproduce
Open admin page.
Proposed resolution
We add the variables definition to the class.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | h5p-php83-deprecation-warnings-3464657-2.patch | 552 bytes | ukor |
Issue fork h5p-3464657
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ukor commentedThe patch for v2.0.0-alpha4
Comment #3
ukor commentedComment #4
ukor commentedAdded fix for h5peditor.class.php
Comment #6
avpadernoThe code has never been changed as per this issue.
Comment #7
gfbarbosa commented#4 worked for me, thanks!
Comment #8
avpadernoComment #9
avpadernoComment #10
shivam_tiwari commentedI am working here.
Comment #12
shivam_tiwari commentedI created MR 25 related to it. Checked module code with Drupal 11 setup. At now I committed changes related to the issue only, for Drupal 11 compatibility, there is another issue available related to this project. Changing this issue status to Needs review.
Comment #13
avpadernoComment #14
aurora.luzzardiI'm having more issues too just after requiring the project on the composer:
Comment #15
nicholassThis issue could also be fixed by just updating the h5p library right to something newer than 1.24.4 ?
EDIT: Tried the MR diff but my site is using the h5p library in the vendor folder(./vendor/h5p), not the file being patched in the module (./docroot/modules/contrib/h5p/vendor/h5p)
EDIT2: I guess its because I am not using the dev branch of this module.
Comment #16
nicholassIf on Version: 2.0.0-alpha4 add the following patches to your extras in composer.json
Until the maintainers can get the upstream h5p library updated, watch https://www.drupal.org/project/h5p/issues/3420268
Comment #17
nicholassComment #18
nicholassComment #19
shaundychkoThis patch fixes issues in an old version of the h5p/h5p-core dependency. That has already been fixed in later versions of the dependency. To use the latest version of the dependencies apply patches from the merge requests at #3497789: Support h5p/h5p-core 1.27 and h5p/h5p-editor 1.25 in H5PDrupal.php and #3309446: Remove vendor directory and composer.lock from project repository. The latter adds a build step using Drush to copy the current version of JS/CSS assets into the module directory.