-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
Drupal 7 getLoginURL Fix #8950
Drupal 7 getLoginURL Fix #8950
Conversation
Drupal 7 getLoginURL was not supplying the base url.
Can one of the admins verify this patch? |
@@ -163,7 +163,10 @@ public static function checkUserNameEmailExists(&$params, &$errors, $emailName = | |||
*/ | |||
public function getLoginURL($destination = '') { | |||
$query = $destination ? array('destination' => $destination) : array(); | |||
return url('user', array('query' => $query), TRUE); | |||
$config = CRM_Core_Config::singleton(); |
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 think it could be improved with $baseUrl = CRM_Core_Config::singleton()->userFrameworkBaseURL;
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.
made improvements. Thank you for the input!
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.
Actually - sorry to come late to the party but - shouldn't we be passing the 'absolute' param to the drupal function?
https://api.drupal.org/api/drupal/includes!common.inc/function/url/7.x
Refactored code and added base url in proper location.
jenkins, ok to test |
replaced tabs with space indents |
replaced tab indents with spaces.
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 appears to be passing a complete http://...
url string into the drupal url
function. I'm not sure that will work with clean urls disabled. I suspect the better way to do it would be by setting the absolute
flag to true. Note that the function was being incorrectly used (a third param TRUE
was being passed in but it only accepts 2 params.
@garethdylan361 can you please check the above? |
@colemanw @garethdylan361 I've raised a new PR at #9479. Also checked by enabling/disabling clean urls and it worked fine for me. |
Drupal 7 getLoginURL was not supplying the base url.