Skip to content

Commit

Permalink
Fix untranslated strings when registering new user
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas K. Dionysopoulos committed Aug 25, 2016
1 parent 0c997bd commit 1ce97cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/authentication/facebook/facebook.php
Expand Up @@ -301,6 +301,12 @@ protected function createUser($email, $name, $verified, $offset)
'email2' => JStringPunycode::emailToPunycode($email),
);

// Load com_users language, because the model doesn't do it automatically
$jLanguage = JFactory::getLanguage();
$jLanguage->load('com_users', JPATH_BASE, 'en-GB', true);
$jLanguage->load('com_users', JPATH_BASE, null, false);

// Load the Registration model of com_users and register the new user.
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_users/models', 'UsersModel');

/** @var UsersModelRegistration $model */
Expand All @@ -311,7 +317,7 @@ protected function createUser($email, $name, $verified, $offset)
*
* We do not need to send an account verification email to verified Facebook accounts. These accounts have
* already had their email or phone number verified by Facebook. Therefore verified Facebook accounts get
* immediate access to our site, as the users would expect. Unverified accoutns have to go through the whole
* immediate access to our site, as the users would expect. Unverified accounts have to go through the whole
* email verification process.
*/
$userId = $model->register($data, $verified);
Expand Down

0 comments on commit 1ce97cf

Please sign in to comment.