H5P seems to become mandatory field on multi-lingual website even when configured as optional


I have configured H5P (8.x-1.0-rc11) on a Drupal 8.6.4 website, which is multi-lingual. Added H5P to Basic Page content type as non-required field but made it translatable.

Then created couple of pages with H5P content and translated them as well. All works well as expected. Awesome results so far!!!

Then created a Basic Page but without any H5P content in that. Page published and everything works well. Now translating this page to another language but unable to save it. All attempts to save fail with following error -

Error: Call to a member function set() on null in Drupal\h5p\Plugin\Field\FieldType\H5PItem->preSave() (line 101 of /install_path/public_html/modules/h5p/src/Plugin/Field/FieldType/H5PItem.php)

#0 /install_path/public_html/core/lib/Drupal/Core/Field/FieldItemList.php(233): Drupal\h5p\Plugin\Field\FieldType\H5PItem->preSave()

How can I overcome this error?



BV52's picture

Hi Vinod,

Thank you for reporting this. I created a bug report and you can follow the progress here.