Closed dac514 closed 5 years ago
I believe that in a typical situation, users can upload H5P files: https://github.com/h5p/h5p-wordpress-plugin/blob/a397653434a9875393c95eec366e9940abd5037d/admin/class-h5p-content-admin.php#L344-L373 My understanding of the expected behavior is that if a user uploads an H5P file that represents a new H5P content type for a site, the necessary libraries are automatically installed and the activity type is 'activated.' Hopefully we'd just be able to hook into this behavior with this process?
Hm, I think this could be a number of things. Right before the exception is thrown, try adding the following line:
print_r($core->h5pF->getMessages());
[0] => stdClass Object
(
[code] => missing-required-library
[message] => Missing required library FontAwesome 4.3
)
Package appears to have 4.5?
From the first post, download: https://integrations.pressbooks.network/app/uploads/sites/4/h5p/exports/impressive-presentation-alpha-demo-26.h5p
Look inside,
{
"title":"Impressive Presentation (ALPHA) Demo",
"language":"en",
"mainLibrary":"H5P.ImpressPresentation",
"embedTypes":[
"div"
],
"license":"U",
"preloadedDependencies":[
{
"machineName":"H5P.AdvancedText",
"majorVersion":"1",
"minorVersion":"1"
},
{
"machineName":"H5P.ImpressPresentation",
"majorVersion":"1",
"minorVersion":"0"
},
{
"machineName":"H5P.JoubelUI",
"majorVersion":"1",
"minorVersion":"2"
},
{
"machineName":"Drop",
"majorVersion":"1",
"minorVersion":"0"
},
{
"machineName":"Tether",
"majorVersion":"1",
"minorVersion":"0"
},
{
"machineName":"FontAwesome",
"majorVersion":"4",
"minorVersion":"5"
},
{
"machineName":"H5P.Transition",
"majorVersion":"1",
"minorVersion":"0"
}
]
}
It looks like this content is fairly old, H5P.Blanks 1.4
which is included most likely requires FontAwesome 4.3
which isn't... not entirely sure why it isn't though...
Could you try to just edit and save the content to see if the .h5p file might be out of date?
@icc I just went in and edited the content successfully. The activity was an 'impressive presentation' downloaded from the H5P.com demo site: https://h5p.org/impressive-presentation. It appears that the content type is no longer listed in the hub, however (users can't create new 'Impressive Presentation' activities without uploading an existing file of this type). Perhaps that could be part of the issue?
I can also see that the node for 'Impressive Presentation': https://h5p.org/impressive-presentation indicates that it was "experimental" and that "creating Impressive Presentations might be very difficult, and impossible for people not familiar with 3D creation tools. The authoring tool is only tested in Google Chrome, does not work in Firefox." A little more context: while it's no longer listed in the H5P creation hub, the content type still appears in the examples and downloads list.
To explain why it was in our book -- while testing, I downloaded an activity of each type listed on your examples and downloads page there and put them in a book so we could practice/test cloning activities of every type. I don't know if the activity type is still in Alpha mode or is deprecated/abandoned, but there's a little more information that might be helpful.
I've done a bit of checking and found out that H5Ps doesn't actually support using two versions of the same library. Meaning, there must have been some bug or error that allowed Impressive Presentation to use a version of Blanks that requires a different version of Font Awesome than Presentation itself.
I think the only way of fixing this issue is by upgrading Impressive Presentation and then running the Content Upgrade process for it.
I think the only way of fixing this issue is by upgrading Impressive Presentation and then running the Content Upgrade process for it.
OK.
Source blog has:
$url = 'https://integrations.pressbooks.network/app/uploads/sites/4/h5p/exports/impressive-presentation-alpha-demo-26.h5p'
When I do:
\H5P_Plugin::get_instance()->fetch_h5p( $url )
I ge an exceptiont: "Failed validating .h5p file"
"Impressive Presentation" is not an installed content type on destination blog.
Not sure what to do here. Our users would expect the H5P element to copy over, even if the lib hasn't been installed?
Other URLs work fine because source and destination both have the required content type.