Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Matej @ Shipped Away

    (@shippedaway)

    Hi David,

    I have updated the plugin on my site, and everything works as it should. ??

    Thank you David for the fast response and fix.

    And thank you @zanduino for confirming the issue.

    Cheers,
    Matej

    Thread Starter Matej @ Shipped Away

    (@shippedaway)

    I have checked for the presence of the MLA scripts at the bottom of the page source, but unfortunately, they are not there. I can see others you mention, but none of MLA.

    At the end of all these scripts, though, I can see the “mla-terms-search-form” <form>. In addition to the MLA HTML found in __unstableResolvedAssets, this form at the end is the only MLA code on the page.

    And I think I didn’t explain exactly where the problem occurs well enough before.

    Where it works (Media -> Library)

    Indeed, when I open the Media Library from the WP menu on the left (Media -> Library) in Grid view, then everything from MLA is available. I can filter through images with specific Att. Categories, and I can open a specific image and set categories, tags, etc.

    Where it doesn’t work (Edit post -> Image -> Media Library)

    When I am editing a post (post.php?post=ID&action=edit), and I try to add an image or replace an image by opening the Media Library (Replace -> Media Library), or Image -> Media Library, then it crashes as mentioned in the original post.

    Gutenberg

    I mentioned the Gutenberg editor because, supposedly, in WordPress 6.3, it’s shown inside an iFrame, and the functions for enqueueing scripts/styles have to be used differently. (I do not develop anything WP, I understood this from the mentioned issues posted on github – maybe falsely).

    Also, the Gutenberg version I am using is part of the WordPress 6.3 core (latest version) and not as a separately installed plugin. I have never manually altered this since setting up the site a few years back. It regularly updates, as WordPress does.

    I guess the only way to get the same site for testing purposes as I do, is to install a fresh new copy of WordPress 6.3.

    WooCommerce

    As for WooCommerce, yes, I do have it installed, but I only mentioned it, as I also found one part of the styles/scripts, in addition to MLA, inside the __unstableResolvedAssets, for reference.

    Thank you. I will also send you my site information in detail on email.

    Thread Starter Matej @ Shipped Away

    (@shippedaway)

    Update: This seems to be related to the latest Gutenberg version in WordPress 6.3. I’m researching further, but it seems like many things are broken.

    For reference, I am using the new block editor bundled on WordPress core 6.3, and not a separate plugin (Editor Version is 7.7).

    Found the cause!

    This issue is directly related to the one found here: https://github.com/WordPress/gutenberg/issues/53236

    It seems like in the newest version of Gutenberg editor where it’s displayed inside an iFrame, the “enqueue_block_editor_assets” call does not work, as explained in the comment https://github.com/WordPress/gutenberg/issues/53236#issuecomment-1660982735

    Further down that issue are possible solutions to get around this. Do you presume it’s something you could do in a new version of MLA or is it something that you would recommend me to try to “hack” myself?

    Thread Starter Matej @ Shipped Away

    (@shippedaway)

    Hi David,

    Yes, I’m a developer myself and love to help out on things like this, so others can enjoy it as well. ??

    I have checked, and the mla-media-modal-js-template.php file exists, and I presume you meant the class-mla-media-modal.php, which also exists, and there is code inside.

    As for the scripts existing on the page, I think that’s the issue. The scripts are supposed to be echoed, but they were not.

    I tried getting the element of one (same code as when it fails):

    var e = "mla-terms-search-button";
    var missingTemplate = document.getElementById("tmpl-" + e);
    console.log(missingTemplate);

    And it as expected returned null/undefined.

    On further inspection, I have found that the code for echoing the scripts you mentioned exists in the HTML of the page, but unfortunately, as an escaped string (in JSON):

    It’s part of the script wp-edit-post-js-after, somewhere inside an endless oneliner of the call of “resolve( wp.editPost.initializeEditor( ‘editor’, “post”,…”

    Inside this code, it is included in the value of __unstableResolvedAssets

    Not sure where to go from this, as it seems like something else is also broken, as I see some mention of some WooCommerce script inside of the above-mentioned call.

    Hopefully, this can help out a bit in understanding the situation on my side. But I’m suspicious it’s rather a WordPress bug.

    Kind regards,
    Matej

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