Problem with H5P editor and Postgres (invalid überName in JavaScript)
I’m trying to implement a H5P editor based on a GitHub repo. The editor should use a Postgres database. I hope/expect this not to be a problem as the H5P plugins for Drupal and Moodle to my knowledge also work with Postgres based installations of their respective host systems. The plug-in I use is based on H5P 1.23 while the most recent version for h5p-editor is 1.24.1 and the most recent version for h5p-core is 1.24.0. My editor is working with MySQL, but for Postgres I have to make some adjustments. At the moment I’m stuck. When I upload the Agamotto content (agamotto-80158.h5p), the upload works and I’m being redirected to the edit form, but
- There’s a message in the HTML: Unfortunately, the selected content type 'H5P.Image 1.1' isn't installed on this system.
- There’s a console error: invalid überName in h5p.js:976
- Another errors says Uncaught SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse (\) at Object.success (h5peditor.js:211)
I found very little info on this, someone reported it to be connected to MySQL strict mode. I compared the contents of my Postgres DB with the contents of the MySQL DB inside a standard Wordpress H5P editor. The entries for the h5p.image library look identical, except there’s no created_at entry in Postgres and there are additional columns metadata_settings and add_to in Postgres. I expect these to be caused by the different H5P versions.
Can you help me to make this work?
Thanks
Oliver
Pida
Fri, 09/25/2020 - 12:14
Permalink
There's a problem in h5p-editor.class.php
I found out that in h5p-editor.class.php there's a getLibraries() function that adds some keys to every library object - but only if $devLibs is not empty. In my case, $devsLib is empty, so no uberName/überName is set.
$devLibs is only set if ($this->h5p->development_mode & H5PDevelopment::MODE_LIBRARY), I don't know what that means yet.
Pida
Mon, 09/28/2020 - 07:39
Permalink
Version conflict
This was just a version conflict between the Laravel plug-in and the H5P libraries. The plug-in expects H5P 1.23, but somehow '1.24' found its way into the plug-ins composer.lock after I migrated to the Postgres environment.