Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

garethdylan361
Copy link

Drupal 7 getLoginURL was not supplying the base url.

Drupal 7 getLoginURL was not supplying the base url.
@civicrm-builder
Copy link

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();
Copy link
Contributor

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;

Copy link
Author

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!

Copy link
Contributor

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.
@totten
Copy link
Member

totten commented Aug 30, 2016

jenkins, ok to test

@garethdylan361
Copy link
Author

replaced tabs with space indents

replaced tab indents with spaces.
Copy link
Member

@colemanw colemanw left a 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.

@colemanw
Copy link
Member

@garethdylan361 can you please check the above?

@jitendrapurohit
Copy link
Contributor

@colemanw @garethdylan361 I've raised a new PR at #9479. Also checked by enabling/disabling clean urls and it worked fine for me.

@colemanw colemanw closed this Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants