I have a couple forms on my website that allow users to sign up for newsletters. When a user submits the form, the page refreshes with a success/failure message displayed using drupal_set_message().
When we have boost enabled, the forms continue to work properly but the messages set with drupal_set_message() never display after a form submission.
I have confirmed that the URL of the submitted page has the ?nocache=1 parameter and doing a view source does not show the cached by boost comment at the bottom of the page.
Is there a configuration setting I need to change to allow this to work? I do have the option "Do not cache if a message is on the page" enabled on the boost configuration screen.
Thanks.
Comments
Comment #1
mikeytown2 commentedhow are you doing the redirect on submission, drupal_goto? what module is in use?
Comment #2
shawn_smiley commentedI'm seeing this both in the sidebar block provided by the constant contact module and on a custom form I created. My custom form isn't doing anything specific with redirect. The user just stays on the form page with the submission results being displayed via drupal_set_message().
The form validation messages do work correctly with boost enabled. It's just the submission result message that does not display. I have confirmed that the form submission does add the user to the mailing list even though it doesn't display the result message.
The result message does display on the form if we disable boost or if the user is logged into the site.
The actual form is at http://www.preparemaine.org/get-updates if seeing it helps.
Comment #3
shawn_smiley commentedSome additional information on this. Just disabling the boost caching on the performance page is not enough to get the drupal_set_message() calls to work. I had to completely uninstall the boost module from the site in order for these messages to display on our site.
This is also impacting the form_set_error() call too.
Below is the code from our form submit handler. None of the calls to drupal_set_message() or form_set_error() display an error message when the boost module is installed on our site.
Comment #4
josephcheekwe're seeing this with moderated comments. comment.module has
cache_clear_all();
and then
drupal_set_message(t('Your comment has been queued for moderation ...'));
but the dsm() call is never seen by the user as cache_clear_all() doesn't clear the boost cached pages on the filesystem.
Comment #5
memoday commentedHi all,
I am having a serious problem. Whenever I put the following URL http://www.mysite.com/?nocache=1 in the browser, all records with full pagers are displayed.
If you go to http://www.mysite.com, you get an empty page view with 2 search fields, but I have just found out that after a user registers in my site, they get redirected to http://www.mysite.com/?nocache=1 and all my records (CCK fields) are displayed. I disabled boost module and it does not redirect the users after registration to the nocache=1 page.
That said, I still get everything displayed when I get to http://www.mysite.com/?nocache=1.
I really need to protect this data and make it accessible only if a user preforms a search in the view.
Is there any way to prevent/block access to this nocache=1 url.
Your help is much appreciated.
Comment #6
patrickroma commentedSame Problem as #5 any help?
Comment #7
bgm commentedCan you grep for "nocache" in your Drupal code base (modules) and see if by any chance another module is not interfering?
Did you test with a 6.x-1.x dev snapshot?
Can you provide a minimal configuration to be able to reproduce this?
Thanks
Comment #8
Jānis Bebrītis commentedi don't know about d6, but d7 had this problem, i fixed it like this: http://drupal.org/node/1242416#comment-5507534
it was because it would GET page that was previously cached (without message). i had to purge page from cache on POST request and whenever there's a $_SESSION['message'] defined;
hope this helps