You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!(isset($field->optional) && $field->optional)) {
// Check if field is in group.
if (! property_exists($group, $field->name)) {
//$this->h5pF->setErrorMessage($this->h5pF->t('No value given for mandatory field ' . $field->name));
}
}
}
yields
Warning: First parameter must either be an object or the name of an existing class in /foo/h5p/h5p-php-library/h5p.classes.php on line 3893
if there's a group that contains only one item and the optional property is not set.
I think that's actually a problem with core turning a one item group from an array with one object into just an object. The default property then has to be set on the group, not on the item, in order to be used correctly by the editor. The code referenced above, however, doesn't use that one leading to the error message if the optional property is not set for the item.
The text was updated successfully, but these errors were encountered:
otacke
changed the title
Host system complaining
Host system complaining when item in one item group doesn't have the 'optional' property
May 5, 2019
The problem remains using the master branch. If you have a one item group in semantics that has a default property, but the optional property is not set to true, you still receive the warning message.
On the release version, this part of the code
h5p-php-library/h5p.classes.php
Lines 4025 to 4032 in 5d7b480
yields
if there's a group that contains only one item and the optional property is not set.
I think that's actually a problem with core turning a one item group from an array with one object into just an object. The default property then has to be set on the group, not on the item, in order to be used correctly by the editor. The code referenced above, however, doesn't use that one leading to the error message if the optional property is not set for the item.
The text was updated successfully, but these errors were encountered: