• Resolved mooer

    (@mooer)


    Hi,

    I’m using your blocks in combination with the Essential Blocks plugin. I have created several pages with EB Accordion blocks nested within EB Accordion blocks, and within those I’m using Spectras Image gallery block. It works as intended – see https://akutrum.se/pocus-bukaorta/

    Regarding the page I need help with (https://akutrum.se/pocus-lungor/), there’s a “Tabs block” nested within the “Accordion block”. For some reason the page freezes (no buttons are clickable) after ”bilddokumentation & undersökningsteknik” is opened. If I remove the Spectra Image Gallery block from that accordion, it works fine. I’ve tried using the Essential blocks gallery block instead, and while I much more prefer the Spectra block, it doesn’t cause the page to freeze. This leads me to believe that there’s some faulty interaction between EB Tabs block and Spectras Image gallery. Here’s a test page demonstrating that EB gallery works fine: https://akutrum.se/test-post/

    While troubleshooting I noticed another weird thing. When opening the faulty page in the wordpress editor, and saving it without ding any changes, the page works for a couple of minutes. After a short while the error reappears. Not sure if this helps in any way.

    Thanks,

    mooer

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support BSF – Ravi Gojiya

    (@ravigojiya)

    Hi @mooer,

    Thank you for reaching out to us and for the detailed report.

    Spectra Image Gallery lightbox is failing to initialise on that page, and when it fails it leaves an invisible full screen layer sitting above your content.

    The cause is a single image caption in that gallery. One of the captions ends with the words knuckles to the bed, wrapped in straight double quotes. Those quote characters break the page scripts Spectra saves for that page, and your browser console shows the resulting syntax error. Your working page has no double quotes in its captions, which is why it behaves normally.

    This also explains what you noticed about saving. Right after a save the scripts are correct, then the broken saved copy takes over again, which is why it works for a few minutes before the problem returns.

    To fix it right away:

    • Go to Media, then Library, and open the image whose caption ends with knuckles to the bed.
    • Remove the two straight double quote characters from the Caption field, or replace them with single quotes.
    • While you are there, check the Caption and Alt Text of the other images in that gallery for the same characters.
    • Open the page in the editor and click Update once, so the page scripts are generated again.
    • Clear all caches on your site and any caching service you use, then reload the page.

    Clicks should work normally after that.

    We have already logged this as a bug on our side and the fix has been approved by our development team, so it will be handled properly in an upcoming Spectra release and will not need any manual work from then on.

    If you would rather not edit the captions, here is a temporary snippet that works around it by telling Spectra to build the page scripts fresh on every load instead of reusing the saved copy. Add it through a snippets plugin such as Code Snippets or WPCode, which makes it easy to remove later, or in your child theme functions.php file.

    /**
    * Temporary workaround for a Spectra Image Gallery issue where a double quote
    * in an image caption or alt text breaks the saved page scripts.
    * Please remove this once the Spectra release with the fix is installed.
    */
    add_filter( 'get_post_metadata', 'spectra_bypass_assets_cache', 10, 4 );
    function spectra_bypass_assets_cache( $value, $object_id, $meta_key, $single ) {
    if ( '_uag_page_assets' === $meta_key ) {
    return array( array() );
    }
    return $value;
    }

    add_filter( 'update_post_metadata', 'spectra_skip_assets_cache_write', 10, 3 );
    function spectra_skip_assets_cache_write( $check, $object_id, $meta_key ) {
    if ( '_uag_page_assets' === $meta_key ) {
    return true;
    }
    return $check;
    }

    Here is our guide on adding custom code, in case it helps: https://wpastra.com/docs/add-custom-php-code/

    Please give the caption change a try first and let us know how it goes.

    If the clicks still do not work after clearing your caches, share a screenshot of your browser console on that page and we will take another look.

    Have a great day ahead!

    Thread Starter mooer

    (@mooer)

    Removing the quotation marks solved the issue. Thank you!

    Plugin Support BSF – Ravi Gojiya

    (@ravigojiya)

    Hi @mooer,

    That is great to hear, thank you for confirming.

    Your report is a good example of how much difference the details make. Sharing both a working page and a broken one, along with the observation that saving fixed it briefly, is what let us narrow this down quickly instead of hunting around for it. So thank you for taking that time.

    The fix is with our development team now and will go out in an upcoming Spectra release, so this will be handled properly from then on with nothing needed from your side.

    If anything else comes up while you are building, we are always here to help.

    Have a nice day ahead!

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

You must be logged in to reply to this topic.