"unabletocopy" when creating H5P content in WP

Hi Guys,

So we had a source WP blog with H5p plugin installed. Works fine.

We then cloned the blog (https://premium.wpmudev.org/project/cloner/) and now when we save any H5P content it comes up with the message "unabletocopy" and does not display the content.

The content appears in the list of H5P content and it can be edited and the object is saved, but still does not appear in the preview, or with the shortcode - same ""unabletocopy"  appears when saving.

Have tried updating the content library and also deactivateing / reactivating the plugin.

Any idea?

Alex

I've just checked both sites settings in the network admin and both sites have identical "H5p H5p Site Uuids"

Could this be the issue? What does the guid do, and how to would I recreate it for each site? Is it simply a unique identifier, randomly generated, or is it created from some hashed data?

Alex

tomaj's picture

The uuid doesn't matter in what you are trying to do. Here is what it's for.

Changing the guid didn't work. Ive poked around and found the problem feedback - its coming from line 270 of h5p-default-storage-class.php

It clearly can't find the directory as I'm getting it to spit out some debug:

  • unabletocopy/data/httpd/efolio/htdocs/blog/wp-content/blogs.dir/14908/files/h5p/libraries/H5P.AdvancedText-1.1
  • Is there ANY way I can force it to create these directories?
  • Or could you put a check in somewhere that if the DIR doesn't exist then create them. 
  • Alex

Apologies for the frantic posts - this is on a live blog with active students who are trying to create content now.

So looks like after the site was cloned the h5p/libraries simply wasn't created.

I've now recreated all the directories it was missing by hacking the source, deacticvated / reactivated plugin and uploaded latest libraires. The 'unabletocopy' message has gone, but still no joy.

Getting a "Unable to find constructor for: H5P.Chart 1.1H5P.error @ h5p.js?ver=1.7.3:865

h5p.js?ver=1.7.3:978 Uncaught TypeError: Cannot read property 'getCopyrights' of undefined(…)"

in the console :(

Giving up for the night.... Any advice. Might have to start a brand new blog - but could do with some kind of checks on hitting the h5p plugin page that all folders / files required are actually there as we use the clone feature A LOT at the uni :(

Alex

tomaj's picture

Can you ensure that the "h5p-chart" is there, and that your system has read rights to the file.

It might be a caching issue too.

tomaj's picture

Try to disable caching by editing wp-config.php, where you add:

define('H5P_DISABLE_AGGREGATION', true);

tomaj's picture

It looks like more people are having a similar problem as you. You might want to follow what happens in this post too. (no definitive answer yet though)

Hi Tomaj,

Thanks for helpful replies. I've got a solution I'll post here in case people have the same issue, and also a couple of queries.

The problem
When the site was cloned using the very handy plugin https://premium.wpmudev.org/project/cloner/ the original site had the H5P plugin activated.
When the new site got cloned it didn't create a 'libraries' folder and so this didn't exist at all.

Solution

The only thing that worked for me was

a) Manually creating the libraries folder and copying over the library content
b) I ALSO had to add the define('H5P_DISABLE_AGGREGATION', true); in the wp-config.php to get it to work

Queries
Unfortunately I need to to this in the future i.e. clone sites that may have had the H5P plugin activated and need a process that works.

So my queries are:
a) When the site is cloned, the H5P UUID number in the site option gets duplicated. What effect would this have, if any? What does the UUID number actually do?

b) What does the define('H5P_DISABLE_AGGREGATION', true); actually do? Will it affect site performance?

c) Would it be possible for you add a check when on the H5P admin page to see if the H5P folder exists, and it not create it. I assume this happen in plugin activation, but ideally it would be checked quickly each page load, in case there are circumstances like this where the plugin may not have been activated in teh usual manner.

Thanks again! We'll share the students content creation when they've finished their projects.

Alex

thomasmars's picture

I'm happy you were successfully able to find a solution for this.

For you questions:

a) The UUID is a unique identifier for your site, which is used when providing anonymous usage data for the plugin. Sending these datas can be toggled in the H5P settings.

b) Toggling this setting to true disables file aggregation. Using file aggregation will cache and concatenate the javascript and css used in the H5P libraries, so they can be loaded faster. It will likely affect site performance negatively.

c) I think the best way to get this done is to appeal to the community by creating an issue in the wordpress repository, where it can be discussed and picked up by community members with development resources.

I'm really looking forward to seeing the shared content, thanks a lot for this update! :)

- Thomas