Bug redirect success page

Permalink Browser Info Environment
Hi,

There is a bug when we submit form...

Normally we are redirected to the same page as block is display with variable which specify that it's a success...

But redirect not add variable in URL and success message is not displayed :

In the block's controller :

$redirect = BASE_URL . View::url();
return nothing because View::url() return "/" if parameter is empty

so, replace :

$redirect = BASE_URL . View::url(); //Location headers should be absolute URI's (seehttp://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30)...
         $redirect .= (strstr($redirect, '?') ? '&' : '?') . 'emailListSignupSuccess=1';
         header("Location: " . $redirect);
         die;


by :

$this->sendMessage('emailListSignupSuccess', $this->submitSuccessMsg);

Type: Discussion
Status: New
orange73
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Hello,
Thank you for bringing this bug to my attention! I have fixed this and updated the package.

Note that the solution you posted here is not ideal -- you always should redirect after a successful form submission, otherwise if the user hits the "back" button on their browser, they will be asked to re-submit the form.

I have changed the code so that the redirection now goes to the page that the block is on (not the home page).

-Jordan
mackadmin replied on at Permalink Reply
mackadmin
Hi Guys,
I have the problem that after email confirmation thre is empty page instead of i.e. default page.
jordanlev replied on at Permalink Reply
jordanlev
What version of Concrete5 are you using?

When you added the block, is the "Display Messages In Block" checkbox checked or unchecked? If it's un-checked, did you add the necessary line of code to your theme's header (go to the marketplace page for this addon and scroll down to the "HOW TO DISPLAY ERROR/SUCCESS MESSAGES ANYWHERE ON THE PAGE:" section)?
mackadmin replied on at Permalink Reply
mackadmin
Hi There,
yes, I did and thats OK but affter the person resived an email to confirm Newsletter there is an obligation to fallow link into my page and then... the page is empty. (Confirmation is success but page doesn't look OK;)

Best Regards
jordanlev replied on at Permalink Reply
jordanlev
What version of Concrete5 are you using?
Does your theme have a view.php file?
Can you send me a link to the page?

Thank you.
mackadmin replied on at Permalink Reply
mackadmin
mackadmin replied on at Permalink Reply
mackadmin
mackadmin replied on at Permalink Reply
mackadmin
jordanlev replied on at Permalink Reply
jordanlev
Hello.
Sorry I did not respond sooner (it is very busy right now).

I think there is an error happening. Go to Dashboard -> Sitewide Settings -> Debug, and change from Production to Development mode, then click the save button, then go back to that page and see if it shows an error message instead of just a blank page. If so, what is the error message?
mackadmin replied on at Permalink Reply
mackadmin
Hello,
I did this and there is a blank page as before.

Best Regards

-----Original Message-----
From: concrete5 Community
Sent: Thursday, December 29, 2011 1:40 AM
To: mack@orangecountry.co.uk
Subject: Bug redirect success page : Questions & Discussion
jordanlev replied on at Permalink Reply
jordanlev
Hmm... well I don't know what the problem could be then.
Can you provide me with an admin login to your site? You can email me directly at: concrete@jordanlev.com
mackadmin replied on at Permalink Reply
mackadmin
Dear Concrete5 Team,
thank you for your great support, there is no words which would describe haw
I cherish your advice but all I can say is Go ahead as well as till now with
the development of your concrete project.

Best Regards
Mack

Have gorgeous year!

-----Original Message-----
From: concrete5 Community
Sent: Thursday, December 29, 2011 2:44 AM
To: mack@orangecountry.co.uk
Subject: Bug redirect success page : Questions & Discussion

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.