• Resolved ypeynaud

    (@ypeynaud)


    Hi Mike,

    First congratulations for your great and useful plugin! I use version 2.1.7. But I get some errors, although the content is (quite) correctly displayed in the modal window.

    The error showed in the console tab:
    “Failed to load resource: the server responded with a status of 404 ()”.

    The error showed in the resources tab:
    “{
    “code”: “post_empty”,
    “message”: “Post is empty”,
    “data”: {
    “status”: 404
    }
    }”

    However, the linked pages do exist. The links work correctly in a non-modal window without the “modal-link” class, and the linked pages actually show quite correctly in the modal window when the class is added. However, I was aware of the error because some anchored content did not position correctly. With anchored content, the error is the same as above and the content is displayed from the top instead of from the anchor.

    Do you have any idea about the issue? Unfortunately I run this in a private staging server so I can’t send a link for you to have a look. Maybe you could point me to some directions?

    Thanks in advance for your help,
    Yves.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter ypeynaud

    (@ypeynaud)

    Anyone having an idea on that? I’m still stuck on it…

    Thanks,
    Yves.

    Plugin Author allurewebsolutions

    (@allurewebsolutions)

    @ypeynaud Unfortunately, it’s hard to debug such issues without looking at it. However, intuition suggests that there is some unavailable asset (image, css/js file, etc.) that is being linked in the page that you’re displaying in the popup.

    For example, on our demo site: https://wp-post-modal.allureprojects.com/
    – click the “What is an apple? (external WikiPedia content)” link and look at the console

    Thread Starter ypeynaud

    (@ypeynaud)

    Hi @allurewebsolutions,

    Thanks for the answer. My site is now online so maybe you could give it a glance and tell me?

    To see the problem:

    – Go to the Privacy Policy page (content only available in French yet):
    https://strategy4startup.com/en/politique-de-respect-de-la-vie-privee/

    – In the first “Objet” paragraph, click on the second link “Définitions”, which should open the site’s General Terms of Use and Sale in a popup window, and scroll down to the “Definitions” article inside the popup.

    As you can see, it doesn’t scroll, and the console returns now the following error:

    TypeError: undefined is not an object (evaluating '$('#modal-content ' + postAnchor).offset().top')

    This is a different error than on my development site but the result in the same: the popup opens but doesn’t scroll. And I’m still not able to understand the issue and fix it.

    Thanks in advance for any tips!

    Regards,
    Yves.

    Plugin Author allurewebsolutions

    (@allurewebsolutions)

    @ypeynaud I just released version 2.1.9, which should fix the issue

    Thread Starter ypeynaud

    (@ypeynaud)

    Unfortunately not. I’ve updated to 2.1.9 and the TypeError is actually solved but I’m back to the 404 error I mentioned earlier.

    Plugin Author allurewebsolutions

    (@allurewebsolutions)

    @ypeynaud Try removing the forward slash preceding the hashtag

    If this works, I’m going to release a new version where it works with or without the forward slash

    Thread Starter ypeynaud

    (@ypeynaud)

    Which slash do you mean? The anchor in the source code is:

    Définitions

    By the way, I realised that the first link in the page (without any internal anchor) generates the same 404 error:
    Conditions Générales d’Utilisation et de Vente du site

    What do I do wrong?
    Thx,
    Yves

    Plugin Author allurewebsolutions

    (@allurewebsolutions)

    @ypeynaud

    As far as I can tell the anchor is this:
    https://strategy4startup.com/en/conditions-generales-dutilisation-et-de-vente/#definitions

    I’m suggesting trying this:
    https://strategy4startup.com/en/conditions-generales-dutilisation-et-de-vente#definitions

    Thread Starter ypeynaud

    (@ypeynaud)

    Thanks for your answer but from my side, the anchor really is the second one, the one without the “/”, not the first one you mention.

    And as I say, the 404 error also happens on a plain page link, without any #, like this one:
    https://strategy4startup.com/en/conditions-generales-dutilisation-et-de-vente/

    This is for example the first link in the page I mentioned:
    https://strategy4startup.com/en/politique-de-respect-de-la-vie-privee/

    So the problem is elsewhere, but where? My javascript understanding is very limited and I’m not able to find out.

    Plugin Author allurewebsolutions

    (@allurewebsolutions)

    I’m not really sure what’s going on without deeper troubleshooting. It seems like it works in some cases and returns 404 error in other cases. And in any case, it does load the content.

    One thing you can try is turning on the “legacy” method in the plugin settings.

    Thread Starter ypeynaud

    (@ypeynaud)

    I tried turning on the legacy method in the plugin settings. It actually removes the 404 errors but the type error I mentioned earlier is still there:

    TypeError: undefined is not an object (evaluating '$('#modal-content ' + postAnchor).offset().top') appearing on wp-post-modal-public.js 224:100.

    Any idea?

    Yes, the page loads anyway, but it doesn’t scroll, and it is really important for me to make the pages scroll at the right place: I use the plugin for ensuring GDPR compliance, and let users easily point to the right article of the right policy, when they subscribe to the site or to the newsletter, or when they contact a service, etc. Not pointing directly to the right article might be interpreted by the authorities as making such users confused, thus NOT complying with GDPR rules. So I do have to make this working, no choice.

    Thanks again for any help in interpreting the error in the js code. I understand CSS, a little of PHP and quite nothing of Javascript. That’s why I use plugins. And yours might be really really useful, particularly with respect to GDPR compliance!

    Yves.

    Plugin Author allurewebsolutions

    (@allurewebsolutions)

    @ypeynaud When I click Définitions, it seems to be working now (with the scroll). Can you confirm? You may need to go into incognito window.

    Thread Starter ypeynaud

    (@ypeynaud)

    Yes! I do confirm it’s working fine now, with version 2.1.9 installed and “Use legacy method” checked.

    It was obviously a cache problem again: opening an incognito window or flushing the navigator cache made it working fine 🙂

    Again thanks a lot for your plugin and your support (I’ve made a small donation to this end).

    Yves.

    Plugin Author allurewebsolutions

    (@allurewebsolutions)

    @ypeynaud I’m very glad it’s working now.

    Thank you so much for the donation!! We really appreciate it 🙂

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Content displayed but error 404 in console’ is closed to new replies.