Redirect after Marker submission

New home Forums Visitor Generated Markers Troubleshooting Redirect after Marker submission

Tagged: 

  • This topic has 6 replies, 3 voices, and was last updated 3 weeks ago by Matthew.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #73189
    janoschasen
    Participant

    Hello,
    after a VGM is submitted there happens a redirect to this page: /wp-admin/admin-post.php instead of a reload.
    Did i set up something incorrectly or is there a current bug?

    Best regards,
    Janosch

    #73190
    janoschasen
    Participant
    This reply has been marked as private.
    #73211
    Matthew
    Moderator

    Hi Janosch,

    Thank you for getting in touch with us, we do appreciate your time.

    Thank you for the link, thus I have debugged this issue accordingly and found the cause of the issue.

    It appears that we called a WordPress function called wp_safe_redirect() after the marker has been added/submitted, however it appears that WordPress now does not automatically exit after the function is called, thus requires the exit() function to be called manually directly afterwards.

    With that said, please may I ask if you would be able to follow the steps below to edit the core code of the VGM Add-on:
    1. Navigate to Plugins -> Plugin File Editor.
    2. Select the “WP Google Maps – Visitor Generated Markers Add-on” in the top-right select dropdown.
    3. Click the “Select” button.
    4. Ensure that the ‘wp-google-maps-ugm.php’ file is selected in the “Plugin Files” navigator on the right-side panel.
    5. Scroll down to around line 1082 whereby you should find the ‘wp_safe_redirect()’ function.
    6. Add a new line with the following code: exit();
    7. Click the “Update File” button.

    The new code section should appear like this:

    // Redirect to this page.
    wp_safe_redirect($_POST['redirect_to']);
    exit();

    Once this has been done, please may you confirm if the issue has been resolved?

    Should you not be comfortable in making these changes, please may I ask if you may reply in a private reply and provide me with your email address so that I may reach out to you directly regarding this?

    I look forward to hearing back from you.

    Kindest Regards,
    Matthew

    #73220
    janoschasen
    Participant

    Hi Matthew,

    thanks for the quick answer. The Exit-Function works like a charm!
    (the redirect was at line 1058 here – if someone doesn’t find ist search for the “wp_safe_redirect”)

    Best regards and thx a lot
    Janosch

    #73225
    Matthew
    Moderator

    Hi Janosch,

    Thank you for getting back to me and most valued time, I tremendously appreciate it!

    I am most happy to hear that issue has been resolved, and it was my great pleasure assisting you with this.

    Please may you kindly consider reviewing our plugin at https://wordpress.org/support/plugin/wp-google-maps/reviews/#new-post?

    It would really mean the world to me! And if possible, please could I kindly ask you to mention both your name and mine in the review for administrative purposes as this would be a tremendous help?

    Should you ever require any further assistance, I am more than happy to help.

    Have a fantastic day further!

    Kindest Regards,
    Matthew

    #73306
    retailsmarter
    Participant

    Thanks so much for posting this fix! The same error is happening on the demo page (https://www.wpgmaps.com/demo/visitor-generated-markers/), FYI. I’m sure you’ll get it sorted and updated soon, but just wanted to add my +1 for help fixing this bug. Thanks for the awesome plugin!

    #73316
    Matthew
    Moderator

    Hi @retailsmarter,

    Thank you for reporting this for our demo and we are happy to hear that this fix has helped you on your site as well.

    Have a great day further!

    Kindest Regards,
    Matthew

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