PHP 8.0 Error: Attempt to modify property "embed_types" on bool

Created on 8 March 2023, almost 2 years ago

Problem/Motivation

Hi community, I am facing issue after upgrading my site to PHP 8.0, when we visit Learning Path some of them are breaking with below error.

Error: Attempt to modify property "embed_types" on bool in Drupal\opigno_h5p\Plugin\Field\FieldFormatter\H5PDefaultFormatter->viewElements() (line 76 of modules/contrib/opigno_module/ActivityTypes/opigno_h5p/src/Plugin/Field/FieldFormatter/H5PDefaultFormatter.php).

Steps to reproduce

Upgrading the site to PHP 8.0

Proposed resolution

I have also resolved this issue by adding a isset condtion for $h5p_content->getLibrary()->embed_types, kindly review and test same.

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇮🇳India Holka_a

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024