- πΊπΈUnited States illeace
I have confirmed this still happens in 2.0.0-alpha5. Here are steps to reproduce this:
- Create a user whose roles do *not* have the "Update H5P libraries" permissions.
- Identify a library that does not yet exist on your install
- Create / download an H5P that uses that library elsewhere
- In the H5P Editor, attempt to upload that H5P
- It will fail with the error "Validating h5p package failed."
- If you navigate to another page on the site, then you will see the "Note that the libraries may exist in the file you uploaded..." message.
- πΊπΈUnited States illeace
Looking closer, this seems like an issue in the H5P core library. In vendor/h5p/h5p-editor/h5peditor-ajax.class.php line 373, in the isValidPackage() function:
$this->core->h5pF->getMessages('error')
... the core library is onlyl getting the error messages and ignoring the info message, the one mentioned in the original post. If either that message was set as an error or if the isValidPackage() function retrieved both info *and* error messages, then we would see that message in the H5P hub immediately. Something like this:
private function isValidPackage($skipContent = FALSE) { $validator = new H5PValidator($this->core->h5pF, $this->core); if (!$validator->isValidPackage($skipContent, FALSE)) { $this->storage->removeTemporarilySavedFiles($this->core->h5pF->getUploadedH5pPath()); $messages = array_merge($this->core->h5pF->getMessages('info'), $this->core->h5pF->getMessages('error')); H5PCore::ajaxError( $this->core->h5pF->t('Validating h5p package failed.'), 'VALIDATION_FAILED', NULL, $messages ); return FALSE; } return TRUE; }
In any case, I think this issue belongs in the H5P core library issue queue and not in the Drupal module.