-
-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#2436 On WordPress, redirect back to the event registration o… #19718
Conversation
(Standard links)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an issue with the flow, only the usage of wp_login_url()
.
CRM/Utils/System/WordPress.php
Outdated
@@ -927,19 +927,43 @@ public function getUniqueIdentifierFromUserObject($user) { | |||
*/ | |||
public function getLoginURL($destination = '') { | |||
$config = CRM_Core_Config::singleton(); | |||
$loginURL = wp_login_url(); | |||
$loginURL = wp_login_url() . ($destination ? '?redirect_to=' . $destination : ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't how wp_login_url()
works - please use it with params as per the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - please see revised version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now 👍
…r contribution page that prompted the user to login. Mostly copied from CRM_Utils_System_DrupalBase.php
@christianwach I assume you want me to merge this? |
@eileenmcnaughton I haven't done an |
@eileenmcnaughton Having said that I'd really like to see an @aydun Could you provide some sample values of |
$destination = NULL; | ||
if ($args) { | ||
// append destination so user is returned to form they came from after login | ||
$destination = CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1' . $args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be forced to the front end or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH this was copied from https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/DrupalBase.php#L488-L505
It works as is for the case described in https://lab.civicrm.org/dev/core/-/issues/2436
I'll remove the other bits and keep it simple. If anyone wants this for PCP's they can add later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drupal doesn't have the same concern about front end v backend as WordPress thoughts @kcristiano @haystack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do an r-run
I am concerned about who it will get the URLs depending on front-end vs back-end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't envisage a situation where this redirect would happen on the back end. If someone can give an example, then yes I'd agree that forcing front end would be necessary.
@kcristiano @christianwach I will merge this & the other one when / if one of you says 'please merge' - so when you are ready please give the order |
@eileenmcnaughton Please merge |
thanks @kcristiano |
thanks @kcristiano |
…r contribution page that prompted the user to login.
Mostly copied from CRM_Utils_System_DrupalBase.php
Overview
See https://lab.civicrm.org/dev/core/-/issues/2436
Before
On WP, event registration and contribution page display a message inviting user to login if the page includes a profile that allows or requires a CMS user registration. After logging in, the user is left at the WP profile page.
After
After logging in, the user is redirected to the original event registration or contribution page.