h5p-editor-php-library icon indicating copy to clipboard operation
h5p-editor-php-library copied to clipboard

Misleading error message on upload

Open t-schroeder opened this issue 6 years ago • 0 comments

When you don't have the capability "mod/hvp:updatelibraries" but try to upload a new Content type, you get a message like this:

Missing required library H5P.GreetingCard 1.0

... although that library was included in the Content type you uploaded. The message seems to come from here:

https://github.com/h5p/h5p-editor-php-library/blob/ecd6c93d9c3a495c111c268f7bb026a18f35078d/h5peditor-ajax.class.php#L322

I noticed that in addition to that "error" message there is also an "info" message being set in PHP but not shown to the user. It reads:

Note that the libraries may exist in the file you uploaded, but you're not allowed to upload new libraries. Contact the site administrator about this.

The latter is a much more helpful message but isn't shown to the user. The one that is shown is misleading because the "missing" library is (or might be) in the uploaded .h5p file. Why is the "info" message not displayed?

t-schroeder avatar Jul 19 '19 16:07 t-schroeder