I'm not sure this is the best place for this but really needing some assistance with this.

Using Drupal 8.8.5 and CiviCRM 5.24.3 along with webform 5.9 and the latest version of webform_civicrm.

This is only a problem when not logged in. If an anonymous user makes payment through a webform (linked to a contribution page that uses an omnipay payment processor), when the user is redirected back to the website it lands on the IPN url with a white screen. It should redirect to the confirmation page but at this point the session variables no longer exist. (Including the url needed and anything I store in $_SESSION)

When making a payment directly through the CiviCRM contribution page there is no problem. And interestingly, if the contribution page is merely visited in the browser first, the webform will then also work correctly and will keep working correctly. Clear the cache in the browser and the webform will again have a problem.

I'm really in the dark with this kind of thing, anyone have any ideas?

  • have you mentioned the payment processor? i see you say "an omnipay pp" but i don't see you specify it – petednz - fuzion Apr 29 '20 at 19:17
  • It's Eileen's Omnipay Multiprocessor with a custom plugin... I don't think there's anything in there that could be the problem though... and it's totally fine in D7, this is the only obscure issue in D8. – Aiden Apr 29 '20 at 19:28

I think session issues sounds more like a D8/CiviCRM configuration issue rather than a D8WFC module issue.

I just confirmed that D8WFC can do live payments (authenticated and anonymous) with iATS Payments. I'm sorry we don't use any Omnipay processors with any of our clients so I can't try to confirm your scenario. Perhaps check on Mattermost -> chat.civicrm.org Drupal channel to see if you can find others who can reproduce this. Some folks in that channel are system administrators themselves and may be able to help.

Here's an example of a live-payment -> with a Confirmation that all lands in the database using D8 CiviCRM Entity:

enter image description here enter image description here enter image description here

  • Thanks for this Karen! I think the problem only comes about with offsite payments... I did figure out a fix but I'm sure it's not the best approach. Perhaps it'll at least give some insight into the problem. Will post it now... – Aiden May 1 '20 at 17:21

I narrowed the issue down to what goes on in initialize() in civicrm-core/CRM/Core/Session.php. When calling the contribution page directly resetScope() is called, which calls initialize() without any argument. When going through webform only createScope() gets called with $isRead set to TRUE every time. This means initialize() is only ever run with $isRead TRUE which means this code never runs:

if (!isset($this->_session[$this->_key]) ||
) {
  $this->_session[$this->_key] = [];

And that seems to make all the difference.

As a quick fix I've added


to alterElements() after the other initialize() in webform_civicrm/src/Plugin/WebformHandler/CivicrmWebformHandler.php. This works but if anyone knows the "right" approach here please let me know.

  • Hey Aiden -> open an issue on drupal.org project webform_civicrm and share the exact code change. – KarinG - Semper IT May 2 '20 at 5:17

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.