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.

Issue fork h5p-3464657

Command icon 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

ukor created an issue. See original summary.

ukor’s picture

The patch for v2.0.0-alpha4

ukor’s picture

Status: Active » Fixed
ukor’s picture

Added fix for h5peditor.class.php

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avpaderno’s picture

Version: 2.0.0-alpha4 » 2.0.x-dev
Assigned: » Unassigned
Status: Active » Needs review
Issue tags: -h5p

The code has never been changed as per this issue.

gfbarbosa’s picture

#4 worked for me, thanks!

avpaderno’s picture

Issue tags: +Needs merge request
avpaderno’s picture

Status: Needs review » Needs work
shivam_tiwari’s picture

Assigned: Unassigned » shivam_tiwari

I am working here.

shivam_tiwari’s picture

Assigned: shivam_tiwari » Unassigned
Status: Needs work » Needs review

I 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.

avpaderno’s picture

Issue tags: -Needs merge request
aurora.luzzardi’s picture

I'm having more issues too just after requiring the project on the composer:

  Deprecated: Optional parameter $prefix declared before required parameter $defaultLanguage is implicitly treated as a required parameter in /var/www/vendor/h5p/h5p-editor/h5peditor.class.php on line 376

  Deprecated: Optional parameter $fileDir declared before required parameter $defaultLanguage is implicitly treated as a required parameter in /var/www/vendor/h5p/h5p-editor/h5peditor.class.php on line 376
nicholass’s picture

StatusFileSize
new81.36 KB

This 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.

nicholass’s picture

StatusFileSize
new318 bytes
new745 bytes

If on Version: 2.0.0-alpha4 add the following patches to your extras in composer.json

"h5p/h5p-editor": {
      "PHP8 notice https://www.drupal.org/project/h5p/issues/3260094": "https://www.drupal.org/files/issues/2022-01-24/Update_H5P-editor_PHP8_compatible.patch",
    "php83 https://www.drupal.org/project/h5p/issues/346465": "https://www.drupal.org/files/issues/2025-01-13/h5p-editor83.patch"
},
"h5p/h5p-core": {
     "php83 https://www.drupal.org/project/h5p/issues/346465": "https://www.drupal.org/files/issues/2025-01-13/h5p-core83.patch"
},

Until the maintainers can get the upstream h5p library updated, watch https://www.drupal.org/project/h5p/issues/3420268

nicholass’s picture

nicholass’s picture

shaundychko’s picture

Status: Needs review » Closed (outdated)
Related issues: -#3420268: Support h5p/h5p-core:1.26 and h5p/h5p-editor:1.25

This 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.