• Resolved leonore33

    (@leonore33)


    Hello,

    I noticed today that when signing up for my newsletter, confirming the subscription or trying to change the profile info, a “400 bad request openresty” page appears instead of the newsletter page with the service messages. The new subscriber is still added so the form and confirmation link work, but the request to the newsletter page for service messages doesn’t.

    My plugin is up to date, and everything was working fine 5 days ago. I have a translated newsletter page (for the french version) that also contains the newsletter shortcode and I tried deleting the shortcode so it doesn’t appear twice in my website but it didn’t solve the problem.

    My newsletter pages (both english and french version) work with the subscription form (aka default content of the page), but not for service messages. My host is o2switch and my browser is chrome.

    Do you have any idea where this could come from and how I can solve it ?

    Thank you in advance

    Leonore

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Stefano Lissa

    (@satollo)

    Hi we should not return bad request (it happens only when the email does not validate) maybe the dedicated page is not set correctly on main settings? Could you temporary set it to “unstyled page”?

    Plugin Author Stefano Lissa

    (@satollo)

    The problem here is the permalink returned:

    /%pagename%/?nm=confirmation&nk=36

    which translation plugin are you using?

    Stefano.

    Plugin Author Stefano Lissa

    (@satollo)

    please, check your permalink configuration page an possibly save them again.

    Thread Starter leonore33

    (@leonore33)

    Hi Stefano, thank you for taking the time to investigate ! If I set the dedicated page to “unstyled page”, it does work (and I get the admin message included that asks me to style the page).

    I use polylang, I took the newsletter shortcode out of the french newsletter page and changed its name so it doesn’t match the main one (I had named them both “newsletter” but the permalink was different as the french one ends with “newsletter-2”).

    I tried saving the permalink of the main dedicated page again. I also configured it on the newsletter plugin settings as the dedicated page and saved again. It didn’t work.

    Also, I tried unlinking the 2 versions so the main page doesn’t have a translation and it didn’t change anything either.

    I don’t really know what else to try, maybe I should do something differently ?

    Plugin Author Stefano Lissa

    (@satollo)

    Hi I restore my polylang blog and see if there are things going wrong, maybe with polylang recent releases. But, actually, we just ask WP the permalink of a page so it is something internal.

    Stefano.

    Hey, I also have this problem and I also use the polylang plugin to translate my website into English.

    My page: https://www.ptpodatki.pl/#newsletter

    • This reply was modified 4 years, 4 months ago by kiczu.

    Hello,

    I found out the issue.
    The issue is on the The Newsletter Plugin, plugin.php file, method:

    
    /**
         * Returns the Newsletter dedicated page URL or an alternative URL if that page if not
         * configured or not available.
         *
         * @staticvar string $url
         * @return string
         */
        function get_newsletter_page_url($language = '') {
    
            $page = $this->get_newsletter_page();
    
            if (!$page || $page->post_status !== 'publish') {
                return $this->build_action_url('m');
            }
            $newsletter_page_url = get_permalink($page->ID);
    
            if ($language && $newsletter_page_url) {
                if (class_exists('SitePress')) {
                    $newsletter_page_url = apply_filters('wpml_permalink', $newsletter_page_url, $language, true);
                }
    	        if ( function_exists( 'pll_get_post' ) ) {
                    $translated_page = get_permalink( pll_get_post( $page->ID ), $language );
    		        if ( $translated_page ) {
    			        $newsletter_page_url = $translated_page;
    		        }
    	        }
            }
    
            return $newsletter_page_url;
        }
    

    This line (1267)
    $translated_page = get_permalink( pll_get_post( $page->ID ), $language );

    has the parenthesis on the wrong place. Should be:

    $translated_page = get_permalink( pll_get_post( $page->ID, $language ) );

    Please fix it!
    Btw, thank you for the excellent plugin!

    I’m not sure if I did it right, but after correcting the file in this way the whole page stops working and pops up syntax error and unexpected ” ) ” on this line.

    Edit: Never mind, that was my bad. The above solution working, very thank you.

    • This reply was modified 4 years, 4 months ago by kiczu.
    Plugin Author Stefano Lissa

    (@satollo)

    Problem found, patch available in tomorrow version.

    Thank you guys!

    Thank you!

    Thread Starter leonore33

    (@leonore33)

    Thank you everyone ! Back to normal on my part, great ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘400 bad request for all service messages’ is closed to new replies.