Documentation Tool and other content types not working anymore - MustacheJS-1.0 etc. missing

Existing and new documentation display a Drupal error "unabletocopy" and content is completely blank.

Could this be an issue with my Documentation library files? the folders below incl. MustacheJS-1.0 are not present.

03/10/2018 11:25	Warning: file_get_contents(sites/default/files//h5p/libraries/docxgenJS-1.0/jszip-utils.js): failed to open stream: No such file or directory in drupal_build_js_cache() (line 5098 of /var/www/html/opigno/includes/common.inc).
03/10/2018 11:25	Warning: file_get_contents(sites/default/files//h5p/libraries/docxgenJS-1.0/jszip.min.js): failed to open stream: No such file or directory in drupal_build_js_cache() (line 5098 of /var/www/html/opigno/includes/common.inc).
03/10/2018 11:25	Warning: file_get_contents(sites/default/files//h5p/libraries/docxgenJS-1.0/docxgen.min.js): failed to open stream: No such file or directory in drupal_build_js_cache() (line 5098 of /var/www/html/opigno/includes/common.inc).
03/10/2018 11:25	Warning: file_get_contents(sites/default/files//h5p/libraries/filesaver-1.0/scripts/FileSaver.js): failed to open stream: No such file or directory in drupal_build_js_cache() (line 5098 of /var/www/html/opigno/includes/common.inc).
03/10/2018 11:25	Warning: file_get_contents(sites/default/files//h5p/libraries/blob-1.0/scripts/Blob.js): failed to open stream: No such file or directory in drupal_build_js_cache() (line 5098 of /var/www/html/opigno/includes/common.inc).
03/10/2018 11:25	Warning: file_get_contents(sites/default/files//h5p/libraries/MustacheJS-1.0/mustache.js): failed to open stream: No such file or directory in drupal_build_js_cache() (line 5098 of /var/www/html/opigno/includes/common.inc).
03/10/2018 11:24	User warning: Unable to open directory sites/default/files//h5p/libraries/MustacheJS-1.0 in H5PDefaultStorage::copyFileTree() (line 475 of /var/www/html/opigno/sites/all/modules/h5p/library/h5p-default-storage.class.php).
03/10/2018 11:24	Warning: opendir(sites/default/files//h5p/libraries/MustacheJS-1.0): failed to open dir: No such file or directory in H5PDefaultStorage::copyFileTree() (line 473 of /var/www/html/opigno/sites/all/modules/h5p/library/h5p-default-storage.class.php).
03/10/2018 11:24	Notice: Undefined index: #title in platon_form_alter() (line 615 of /var/www/html/opigno/profiles/opigno_lms/themes/platon/template.php).
03/10/2018 11:24	Notice: Undefined index: triggering_element in quiz_questions_form() (line 823 of /var/www/html/opigno/profiles/opigno_lms/modules/contrib/quiz/quiz.admin.inc).
03/10/2018 11:24	Notice: Undefined index: triggering_element in quiz_questions_form() (line 820 of /var/www/html/opigno/profiles/opigno_lms/modules/contrib/quiz/quiz.admin.inc).
03/10/2018 11:24	h5p_content: added test documentation.

 
FYI - the Library shows 2 instances with v1.5.6 (and restricted active) and 1 for 1.6.2.  

"Not all content has gotten their cache rebuilt. This is required to be able to delete libraries, and to display how many contents that uses the library.
3 contents needs to get their cache rebuilt."

is that because a new version has been added, either I manually (within the documentation tool) or does this happen automatically to load new versions?
And do i then always need to check if cache needs rebuilding ( in /admin/content/h5p ) and manually upgrade content to the new version ?

UPDATE:
Other content types seem to be affected as well. Is there any reliable way to re-install libraries to fix this for drupal?
Any help is much appreciated, kind of getting desperate and slightly disappointed that it seems not so easy to do, probably due to the complexity with library files and several database tables. Almost giving up as I'm stuck and tried a lot at this stage.


Took a snapshot of my server and tried to re-install h5p libraries:

deleting all folders in /sites/default/files/h5p/libraries/ and drop table content of h5p_libraries

Not sure if the table h5p_libraries_libraries (library dependancies) could be fully dropped as well - expecting this to be created as part of installing library modules. Same with h5p_libraries_hub_cache & h5p_libraries_languages.

I kept h5p_nodes (where nodes are stored) & h5p_nodes_libraries (what nodes uses which libraries).

After which I manually installed the missing libraries via the hub "get" buttons,
but then launching existing and new content I get the error:

"Sorry, preview of H5P content is not yet available."

Console errors: Uncaught ReferenceError: H5P is not defined

js_MJbFItfT_P4dYexhpLFWQ0U9NiyG2Jd042p_kvZJvE8.js:349    

at HTMLDocument.<anonymous> (js_MJbFItfT_P4dYexhpLFWQ0U9NiyG2Jd042p_kvZJvE8.js:349)
at l (js_YuEc2f5gfO95NeKh-MT-oUH-EFnAOLKGulfBG4YusJQ.js:2)
at Object.fireWith [as resolveWith] (js_YuEc2f5gfO95NeKh-MT-oUH-EFnAOLKGulfBG4YusJQ.js:2)
at Function.ready (js_YuEc2f5gfO95NeKh-MT-oUH-EFnAOLKGulfBG4YusJQ.js:2)
at HTMLDocument.A (js_YuEc2f5gfO95NeKh-MT-oUH-EFnAOLKGulfBG4YusJQ.js:2)


    if (H5P && H5P.externalDispatcher) {
      // Get xAPI data initially
      H5P.externalDispatcher.once('domChanged', function () {
        storeXAPIData(getH5PInstance(this.contentId));
      });

      // Get xAPI data every time it changes
      H5P.externalDispatcher.on('xAPI', function (event) {
        storeXAPIData(getH5PInstance(this.contentId), event);
      });
    }

 

fnoks's picture

Hi,

I have no idea what will happen if you truncate one of the H5P tables. It is not something we never recommend doing.

I think I would have a look at the original problem and checked if the sites/default/files//h5p/libraries/docxgenJS-1.0/jszip-utils.js file exists, and also check file permissions. If you need to upload an already existing H5P library (with the same version number), you can do that on Drupal 7 by enabling "H5P development mode" on /admin/config/system/h5p, and the upload the library.

docxgenJS-1.0 is missing as well (permission are good), not sure why / when this happened. I had to re-install h5p once though due to issues with interactive video when step 2 has stopped working properly.

Will I have to download libraries from https://github.com/h5p or are there pre-packages available with the correct folder names?
My concern is that it looks to me that manual install in the hub installs additional modules required due to dependencies? Can I check this as well somewhere and ensure I have them all?

fnoks's picture

You should download the Documentation Tool example from h5p.org, and upload it through the library admin page (admin/content/h5p). Note: H5P development mode must be on.

awesome, that fixed it. I had to upgrade some of the other ones to newer library to work again - as i was missing the old libraries :)
Btw. I didn't think the example downloads them self were the modules to download, i thought this is a package with the example questions/content displayed on https://h5p.org/content-types-and-applications :)