Thanks pgr, I have arrived at the same place, but I canāt find a column or field for āutā in the DB in the users or user preferences tables, or anywhere in Bean Land. I would be most interested to see the files field_arrays.php and vardefs.php from the ā¦/modules/UserPreferences directory of a working 7.14.5 system. I may need to do a clean install of 7.14.5 if nobody can help.
You can find the original files in GitHub, start by going into the correct branch for your intended version, then navigate the directories to get to the file.
Some user preferences are stored inside a base64-encoded JSON field in user table.
Search these forums for base64decode to learn about this. Itās not too difficult to get and set those parameters manually, and it really helps troubleshooting.
Thanks pgr, much appreciated. Iām sure learning a lot!
Was thinking I was the only one with that issue, but look like not,
Started with SuiteCRM 7.14.6
For now I just press next quickly to access to the CRM.
Bug reported here: Regression: Local users gets Profile wizard on each login Ā· Issue #10637 Ā· salesagility/SuiteCRM Ā· GitHub
There is also a fix proposal.
This proposed fix dont actually stops the user being redirected to the profile wizard.
The real problem beneth it is that if the user has the the global variable syncGcal set to true and the google calendar is active then the function getGoogleClient in public/legacy/include/GoogleSync/GoogleSyncBase.php will wipe out all the global variables of user preferences except GoogleApiToken that will be overwritten.
And since the variable āutā is not set (because does not exist) the user will always be redirect to the wizard page.
public/legacy/modules/Users/ChangePassword.php
if (empty($ut)) {
// SugarApplication::redirect('index.php?module=Users&action=Wizard');
SugarApplication::redirect('index.php?module=Users&action=Wizard');
}
Actual Fix
public/legacy/include/GoogleSync/GoogleSyncBase.php
Before
// Refresh the token if needed
if ($client->isAccessTokenExpired()) {
$this->logger->info(__FILE__ . ':' . __LINE__ . ' ' . __METHOD__ . ' - ' . 'Refreshing Access Token');
$refreshToken = $client->getRefreshToken();
if (!empty($refreshToken)) {
$client->fetchAccessTokenWithRefreshToken($refreshToken);
// Save new token to user preference
$this->workingUser->setPreference('GoogleApiToken', base64_encode(json_encode($client->getAccessToken())), 'GoogleSync');
$this->workingUser->savePreferencesToDB();
} elseif (empty($refreshToken)) {
throw new GoogleSyncException('Refresh token is missing', GoogleSyncException::NO_REFRESH_TOKEN);
}
}
After
// Refresh the token if needed
if ($client->isAccessTokenExpired()) {
$this->logger->info(__FILE__ . ':' . __LINE__ . ' ' . __METHOD__ . ' - ' . 'Refreshing Access Token');
$refreshToken = $client->getRefreshToken();
if (!empty($refreshToken)) {
$client->fetchAccessTokenWithRefreshToken($refreshToken);
// Save new token to user preference
$this->workingUser->setPreference('GoogleApiToken', base64_encode(json_encode($client->getAccessToken())), 0,'GoogleSync');
$this->workingUser->savePreferencesToDB();
} elseif (empty($refreshToken)) {
throw new GoogleSyncException('Refresh token is missing', GoogleSyncException::NO_REFRESH_TOKEN);
}
}
That extra 0 makes the fourth argument be your category, so only the GoogleSync bucket gets written, and your Global prefsāincluding ut and timezoneāstay untouched.