0

When submitting a contribution form, I first get taken to what seems like a truncated URL: https://mysite.example.com/donate/?page=CiviCRM&q=civicrm/contribute/transact. The HTTP response code is 302 and I get redirected to https://mysite.example.com/donate/?page=CiviCRM&q=civicrm/contribute/transact&_qf_Confirm_display=true&qfKey=ea68d5378e175112aace8d733a982f53_5648. Then the response code is 200 and the page displays all fine. I'm seeing all of this in the Network tab of the browser's developer tool.

My question is whether this is the intended behavior of Civi. This redirect seems rather odd to me.

I'm using Civi 4.6.8 with Wordpress 4.3.1 (multisite). I use a shortcode to load the contribution form into the Wordpress page (but without hijacking the whole page).

UPDATE:
I tried this on the Civi Wordpress demo site - http://wp46.demo.civicrm.org/contribution-page - and I get the absolutely same behavior. First a truncated URL and a redirect to the complete URL. I also tried the test-drive link on the backend: http://wp46.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&reset=1&id=1&action=preview . When clicking Confirm Contribution there is again a redirect and then we get to the complete URL. So this redirect behavior doesn't seem to be related to the use of the shortcode.

  • 1
    it is often worth comparing what happens on your site with what happens on the demo site and then asking why it might be different on your set up. – petednz - fuzion Dec 8 '15 at 0:46
  • Good idea, @petednz-fuzion. I tried it on wp46.demo.civicrm.org/contribution-page and I get the absolutely same behavior. First a truncated URL and a redirect to the complete URL. I also tried the test-drive link on the backend: wp46.demo.civicrm.org/wp-admin/… . When clicking Confirm Contribution there is again a redirect and then we get to the complete URL. So this redirect behavior doesn't seem to be related to the use of the shortcode. – Borislav Zlatanov Dec 8 '15 at 12:55
  • 1
    great - always worth giving others a steer on what 'expected' behaviour and 'demo' behaviour is. suggest you Edit the OP with some of that info to make sure it is upfront for others. Can't help you further myself. – petednz - fuzion Dec 8 '15 at 19:35
  • also perhaps worth confirming are the outcomes the same when you use Pay Later v Payment Processor? Wondering if it might be a payment processor issue but you provide no details in that respect – petednz - fuzion Dec 10 '15 at 1:05
1

So when filling the form, you submit it (the data is into the post, so you have the feeling it's truncated as you don't see the params in the log/net tab). Once that data is processed, it needs to display something (the confirmation that everything went well).

They are two ways of doing that: - either the result of the post is the confirmation message - or you redirect to another page that displays the confirmation message

the second one (the one yo experienced) has several benefits: it's easier to redirect to another page (so you have a completely custom and different thank you page from outside of civi, and as importantly, it allows you to reload the confirmation page without resubmitting the contribution (that's why you have warning from your browser when you reload a page after you submit something)

Now, that design choice made many years ago doesn't make that much sense when you have forms in ajax (eg. with payment providers like stripe), but I don't think it's a problem to do a redirect, it doesn't create a major speed difference.

So in short: it's normal behaviour, nothing to worry about ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.