• Resolved ma0301

    (@ma0301)


    Hey! I am desperate. I really need to create new content I constantly get the error message “error, unable to load libraries.”
    My existing content is still visible and usable, but I cannot create new content. So as soon as I click to add new content, the error appears. Same thing happens when I press the button to create a new item.


    I am using:
    WordPress 6.9.4
    H5P Plugin newest Version 1.17.4
    in German language
    PHP Version 8.3.30

    As soon as I click on the blue “Add new” (“Erstellen”) button in the “add” (“Hinzufügen”) menu of the plugin in the admin view of wordpress I get these errors in the console:

    Uncaught TypeError: can't access property "form", this.selector is undefined
    no selector defined for "getParams"
    no selector defined for "getLibrary"
    

    What I have already tried but did not help:
    – Deactivated ALL plugins except H5P
    – switched to default WordPress theme
    – reinstalled the current wordpress version
    – Completely reinstalled H5P (manually via FTP, fresh files)
    – Checked /uploads/h5p/libraries → structure looks normal (no version mismatch issue like -x.y.z as it was hinted in a forum post)
    – Checked REST API → /wp-json/ works correctly
    – Tried different browsers and cache cleared
    – used the “manage libraries” (“Bibliotheken verwalten”) menu to clear cache and update the libraries as suggested in the menu itself

    Please, if anyone can help me to get rid of this problem! 🙁 I really need to create new content at the moment that is important for my learners in learndash.

    Some additional information:
    Before it stopped working I updated a lot of plugins. But as I said, I deactivated everything and it still didn’t help.

    I highly appreciate your help!

    • This topic was modified 2 months ago by ma0301.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author icc0rz

    (@icc0rz)

    This part of the code should only run when storing the content, but you’re saying this happens as soon as you navigate to the page?
    If that is the case there must be some other script or browser extension triggering the submission of the form as soon as you enter the page. You could try using incognito/privacy mode in your browser to rule out any extension interference.
    To figure what it is you probably need to add a debugging breakpoint to the following line: https://github.com/h5p/h5p-wordpress-plugin/blob/master/admin/scripts/h5p-editor.js#L66

    If you are comfortable sharing access I could have a look; frode.petterson (at) h5p.group

    Thread Starter ma0301

    (@ma0301)

    I have tried using different browsers, so it should not be the case that a browser extension is causing this.

    But it is not happening right after navigating to the “Hinzufügen” (“Add”?) menu. The code I posted is happening as soon as I press the blue button “Erstellen” (Probably “add new” or “create new” in English?).

    Navigating to the menu without doing anything more is just showing in HTML “error, unable to load libraries”.

    I am sorry, I am using wordpress in German, English is not my first language so I might write some confusing sounding things sometimes 😉 I am happy to clarify everything if things are unclear!

    If we can somehow solve it without giving access to our wordpress I would prefer this option, I would feel more comfortable about the data that is stored there. But if we can’t solve it without I will think about it! 🙂 Thanks for that offer!

    Plugin Author icc0rz

    (@icc0rz)

    Ah, then it’s the inital loading of the library list that fails, and the submission of the page fails as a result of that.

    Open the browser’s debugger (Ctrl/Cmd+Shift+J in Chrome) then go to the network tab and filter on ‘Fetch/XHR’. Now navigate to or reload the broken page. You should see a request matching ‘admin-ajax.php?token=2d83254e3c&action=h5p_content-type-cache‘ with status 200. Are you able to click it and screenshot it? The start of the content’s should look something like this: {"outdated":false,

    A not so uncommon issue here is that either the web server is modifying the reponse of the request somehow, or a third-party plugin or theme is doing it.

    Thread Starter ma0301

    (@ma0301)

    Hi!

    Thanks! I did as requested, here is a screenshot.

    This happens while reloading the “Add” (“Hinzufügen”) menu!

    Plugin Author icc0rz

    (@icc0rz)

    Ah, I think you’ve found a small bug that happens when PHP logs warnings are printed.

    Are you able to change line 633 in wp-content/plugins/h5p/h5p-editor-php-library/h5peditor.class.php
    from:

          'patchVersionInFolderName' => $local_lib->patch_version_in_folder_name

    to:

          'patchVersionInFolderName' => false

    If that works we’ll release a new version of the plugin with that change.

    Thread Starter ma0301

    (@ma0301)

    Hi! Thanks for the answer, but unfortunately that change hasn’t solved the issue 🙁

    Plugin Author icc0rz

    (@icc0rz)

    Are you able to redo the previous step (with the change applied) and then copy the error message on the first line of the request?

    Thread Starter ma0301

    (@ma0301)

    Yeah sure, un-done!

    Plugin Author icc0rz

    (@icc0rz)

    I’m sorry, I mean checking if the error message in the request was the same after applying the fix. There should only be one instance of ‘patch_version_in_folder_name’ so replacing it should fix it, but you may have other error messages printed that are breaking the request as well.

    Do note for an actual production environment this wouldn’t be an issue as you wouldn’t be printing these types of messages to your users. So, turning of debugging or set setting define( 'WP_DEBUG_DISPLAY', false ); in your wp-config.php will fix this issue as well.

    What’s a bit strange in this case is that we don’t see this issue in the official wordpress docker image even with WORDPRESS_DEBUG: true turned on.

    Thread Starter ma0301

    (@ma0301)

    Ok I am dumb – very sorry!
    So here are the screenshots, the error messages are still the same. But you most probably know more than me what they exactly mean 😉
    Firefox dev console: same error messages after clicking on the blue button on the right “Erstellen”

    Google chrome already shows things by just reloading the “Hinzufügen” Menu page:

    and clicking on the blue button to create new content:

    Thread Starter ma0301

    (@ma0301)

    Ah and of course I forgot to add this screenshot, but it is the same warning as before:

    Plugin Author icc0rz

    (@icc0rz)

    We release a new patch version of the plugin to address this issue. Does updating solve the issue?

    Thread Starter ma0301

    (@ma0301)

    It worked! Awesome, thank you! 🙂
    The Hub is back where it should be!

Viewing 13 replies - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.