h5p / h5p-wordpress-plugin

Adds support for H5P Content in WordPress.
https://wordpress.org/plugins/h5p/
71 stars 74 forks source link

Compatibility with WP 5.5.x #119

Open Trehu opened 3 years ago

Trehu commented 3 years ago

Hi,

I encountered an issue, when trying to create new H5P content in WP-admin panel. Can this be compatibility issue with the latest WP version 5.5.3.

Console error that it spits out:

h5peditor-editor.js?ver=1.15.0:49 GET https://wp-content/plugins/h5p/h5p-editor-php-library/styles/css/application.css?ver=1.15.0 net::ERR_NAME_NOT_RESOLVED

icc commented 3 years ago

It looks like WordPress is having trouble determining the URL of your site. This could be related to the setup. Have you tried adding the following to your wp-config.php file?

define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
Trehu commented 3 years ago

Hi,

Thanks for the quick response.

Haven't yet tried that. I will give it a try.

-Tero

pe 20. marrask. 2020 klo 15.10 Frode Petterson (notifications@github.com) kirjoitti:

It looks like WordPress is having trouble determining the URL of your site. This could be related to the setup. Have you tried adding the following to your wp-config.php file?

define( 'WP_HOME', 'http://example.com' ); define( 'WP_SITEURL', 'http://example.com' );

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/h5p/h5p-wordpress-plugin/issues/119#issuecomment-731161005, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMFR6LNQ3M3RT46V2RZIGPTSQZTDFANCNFSM4T4NRSWA .

jlariza commented 3 years ago

@icc I am having the same issue but it is not wordpress related; I think it is produced by Jquery. The issue is that on this file wp-content/plugins/h5p/h5p-editor-php-library/scripts/h5peditor-editor.js:44 both ns.assets.js and ns.assets.css links are being loaded with double slash // so JS assumes it is an absolute path, not a relative path.

I tried to find what is happening but got no luck. I implemented an ugly fix to make it work for now

    ns.assets.js = ns.assets.js.map(
      function(item){
        return item.replace("//", "/");
      }
    );
    ns.assets.css = ns.assets.css.map(
      function(item){
        return item.replace("//", "/");
      }
    );

Thank you

icc commented 3 years ago

Thanks for sharing, I'll be on the lookout for this.

otacke commented 3 years ago

@icc Maybe something similar to https://github.com/h5p/h5p-editor-php-library/pull/125