- Issue created by @drupalfan2
- 🇨🇦Canada ydahi Waterloo, Canada
Can you please provide some more details?
For which content type is this error occuring? Which version of Drupal?
- 🇦🇹Austria drupalfan2
Drupal 10.4.7.
I don't know which content type it is. Where can I see it?
This is an issue concerning "Active Surface". Where is the option to enable or disable "Active Surface" in an existing H5P content?
I think.
Before updating an H5P content with Active Surface enabled must be created.
Now the update has to be done.
Afertwords the error "Cannot read properties of undefined (reading 'activeSurface')" may or can appear as it does in my case.Thank you.
- 🇦🇹Austria drupalfan2
More details:
Case 1, no problems:
composer require drupal/h5p:^2.0.x-dev#df0872a9
installs dev version at commit df0872a9. No activeSurface error. Everything is okay.
The patch
https://www.drupal.org/files/issues/2024-02-14/support-h5p-1.26-3420268-... → (Support h5p/h5p-core:1.26 and h5p/h5p-editor:1.25)
is applied successfully.Case 2, activeSurface error:
composer require 'drupal/h5p:^2.0@alpha'
installs latest alpha5 version. The path can not be applied, but seems to be not nessessary.
No I can find differences in the h5p JS script that is located in
sites/default/files/jsCase 1, no problems:
See attached file
https://www.drupal.org/files/issues/2025-06-02/js_AUiF-umUqB2ut8phxE88Wp... →Case 2, activeSurface error:
See attaced file
https://www.drupal.org/files/issues/2025-06-02/js_fC6SHRk3l6uJ9Iz-8_dbvO... →The h5p JS files are different. And file for case 1 contains:
... ||!0===e.activeSurface) ...
but files in case 2 does not contain any 'activeSurface' in JS code.
This may cause the error "Cannot read properties of undefined (reading 'activeSurface')".
How can we write a patch for this problem?
Thank you. - 🇦🇹Austria drupalfan2
This commit
https://git.drupalcode.org/project/h5p/-/commit/289f5587bbcd3b38a6322b0c...
causes the problem: "Simplify asset handling".h5p.js tries to access drupalSettings and more before the document is lodad.
This causes all the problems.You you please rewrite this code?
Thank you.