Support » Plugin: Lazy Loader » Problem with The Events Calendar 5.1.5

  • Resolved palomar83

    (@palomar83)


    Hello Florian,

    I just updated the plugin The Events Calendar from 5.1.4 to 5.1.5 and run into an error which seems to be related to Lazy Loader (the error disappears upon deactivating Lazy Loader).

    On the link to my test website that I indicate, I get this error in my browser. Do you have any idea on how to solve the issue? Thanks. Nicolas.

    Uncaught SyntaxError: Unexpected number in JSON at position 2625
    at JSON.parse (<anonymous>)
    at HTMLDivElement.obj.setup (manager.js?ver=5.1.5:142)
    at Function.each (jquery.js?ver=1.12.4-wp:2)
    at a.fn.init.each (jquery.js?ver=1.12.4-wp:2)
    at HTMLDocument.obj.ready (manager.js?ver=5.1.5:632)
    at i (jquery.js?ver=1.12.4-wp:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
    at Function.ready (jquery.js?ver=1.12.4-wp:2)
    at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • It seems I can solve the problem by disabling Lazy Loader on calendar pages. This snippet in functions.php seems to do the job. I hope this is how to do it because I am not too familiar with coding:

    function disable_lazyloader_custom () {
    if (tribe_is_event())
    return true;
    }
    add_filter( ‘lazy_loader_disabled’, ‘disable_lazyloader_custom’ );

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi @palomar83,

    your workaround looks good!

    The issue is that the events calendar uses a HTML comment inside a script element, and that breaks my function to exclude script contents from the parser via HTML comments.

    I think I found a solution for that, I will release a new version with that in the next days, also containing a few other things.

    Best,
    Florian

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi @palomar83,

    I released a beta version on GitHub that should fix the issue. Could you test it? It is the lazy-loading-responsive-images.zip on https://github.com/florianbrinkmann/lazy-loading-responsive-images/releases/tag/v7.0.0-beta.2

    Thanks!
    Florian

    Hello,

    It seems it works, thanks! The calendar plugin no longer breaks. However it seems it remains a few errors in the browser console: Failed parsing ‘srcset’ attribute value since it has an unknown descriptor.

    Nicolas

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi Nicolas,

    sorry for that, the error was introduced while trying to fix another problem, it should be gone in the latest beta, could you verify that? https://github.com/florianbrinkmann/lazy-loading-responsive-images/releases/tag/v7.0.0-beta.3

    Thanks!
    Florian

    Thank you Florian,

    It solved the problem but now there is another one, my website logo (a png image center top) no longer appears. The code associated is hereunder, it seems there is a problem with srcset. The other images seem ok. Thanks. Nicolas

    img id="desktop-logo" src="https://hautlescours.fr/wordpress/wp-content/uploads/2019/08/HAUTLESCOURSFINAL-400px.png" alt="Haut Les Cours" width="400" height="138" data-src="https://hautlescours.fr/wordpress/wp-content/uploads/2019/08/HAUTLESCOURSFINAL-400px.png" loading="lazy" class=" ls-is-cached lazyloaded" srcset="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20400%20138%22%3E%3C%2Fsvg%3E 400w"

    • This reply was modified 2 months, 2 weeks ago by palomar83.
    • This reply was modified 2 months, 2 weeks ago by palomar83.
    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi @palomar83,

    yes, you are right, the problem is that I was not checking if an image has a srcset before setting the SVG data uri as a placeholder… I fixed that in beta 4 (https://github.com/florianbrinkmann/lazy-loading-responsive-images/releases/tag/v7.0.0-beta.4), could you give it a try? I hope no other issue appears instead of the fixed one now 🙈

    Thanks a lot!
    Florian

    Thanks Florian, it works fine now! I could upload the new version on my production website.

    Best,

    Nicolas

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Thanks for the testing, Nicolas! I’m happy to hear that it works now 🙂

    I will release the new version to the plugin directory after fixing two other open issues.

    I am marking the topic as resolved.

    Best,
    Florian

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.