CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Drupal login redirect strips CiviCRM querystring
Pages: [1]

Author Topic: Drupal login redirect strips CiviCRM querystring  (Read 755 times)

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Drupal login redirect strips CiviCRM querystring
December 04, 2014, 05:15:06 pm
I just discovered this behaviour on two similar websites where we want members to login before they can access the membership renewal pages so that the name and address profile will be filled with their information. This is somewhat important because there is a concern that these particular members will renew a membership without carefully filling out the form fields and we'll be chasing/merging contact records.

To accomplish this we have Drupal CiviCRM permissions for "Make online contributions" to allow for authenticated but not anonymous.

During testing I tried to access the renewal page at /civicrm/contribute/transact?reset=1&id=1 and was presented with a login screen as expected. The problem is that on login, Drupal directed me to /civicrm/contribute/transact. Everything to the right of transact was stripped from the URL.

I'm not sure what's going on here but I checked with another similarly outfitted Drupal/CiviCRM site and I experienced the same behaviour.

Thanks,
Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Drupal login redirect strips CiviCRM querystring
December 05, 2014, 07:37:01 am
Agree that this is annoying. AFAIK drupal strips every query string when redirecting from logins.
One workaround might be to create an alias for that url, not sure if that would solve it but worth a shot.
Try asking your question on the new CiviCRM help site.

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Drupal login redirect strips CiviCRM querystring
December 05, 2014, 09:36:23 pm
Aha! I managed to get it sorted  ;D

I used the Content Access and Rules modules to do it but I might have been able to do it with Rules only. I happened to already have both modules on the site.

I created a page node/xxx that is governed by Content Access, requiring the visitor to be authenticated and called it /members/renew-your-membership.

Then I created a "rule" that redirects requests to node/xxx (where node:id = xxx) to civicrm/contribute/transact?reset=1&id=1

So the link I post for renewing memberships is /members/renew-your-membership and Content Access and Rules takes care of the rest.

The thing that makes it work is that Rules honours Content Access and doesn't redirect unless the visitor has indeed logged in. I tried it earlier with the Redirect module but that didn't work because the Redirect module doesn't pay attention to Content Access. Content Access and Rules works perfectly!

Cheers,
Andrew
« Last Edit: December 05, 2014, 09:38:22 pm by awasson »
My CiviCRM Extension Workshop: https://github.com/awasson

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Drupal login redirect strips CiviCRM querystring

This forum was archived on 2017-11-26.