Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while playing content in v1.24.3 #124

Open
tuxes3 opened this issue May 12, 2022 · 0 comments
Open

Error while playing content in v1.24.3 #124

tuxes3 opened this issue May 12, 2022 · 0 comments

Comments

@tuxes3
Copy link

tuxes3 commented May 12, 2022

While trying to get the integration data for an InteractiveVideo content (with one Single Choice Set) the following error occurs:

property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given

While investing further into this error I found that an unused if statement is causing this. https://github.com/h5p/h5p-php-library/blob/1.24.3/h5p.classes.php#L4037

Commenting out the if solves the error and everything is working as intended.

Here my patch:

--- /dev/null
+++ ../h5p.classes.php
@@ -4034,9 +4034,9 @@
       foreach ($semantics->fields as $field) {
         if (!(isset($field->optional) && $field->optional)) {
           // Check if field is in group.
-          if (! property_exists($group, $field->name)) {
+          //if (! property_exists($group, $field->name)) {
             //$this->h5pF->setErrorMessage($this->h5pF->t('No value given for mandatory field ' . $field->name));
-          }
+          //}
         }
       }
     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant