H5P Upload widget PHP notices

Created on 13 September 2022, about 3 years ago
Updated 27 August 2025, 17 days ago

Problem/Motivation

PHP notices are given when using only H5P Upload widget.

Notice: Undefined index: metadata in Drupal\h5p\H5PDrupal\H5PDrupal->insertContent() (line 868 of /var/www/html/modules/contrib/h5p/src/H5PDrupal/H5PDrupal.php)

Steps to reproduce

1. Install 2.0.0 branch, Drupal 9.4
2. Add H5P field to Basic page content type, set its widget to "H5P Upload".
3. Download https://h5p.org/tutorial-image-hotspots from "Reuse" link.
4. Create a new Basic page and upload the downloaded .h5p file to H5P field.
5. File uploads correctly, but produces PHP notices on log/screen.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇫🇮Finland sokru

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024