Archive mode: fixed the recording of user preferences

SVN:trunk[4779]
This commit is contained in:
Romain Quetiez
2017-06-30 10:00:38 +00:00
parent 813c80499c
commit 990be7a105
2 changed files with 8 additions and 2 deletions

View File

@@ -155,7 +155,9 @@ class appUserPreferences extends DBObject
{
if (self::$oUserPrefs->IsModified())
{
utils::PushArchiveMode(false);
self::$oUserPrefs->DBUpdate();
utils::PopArchiveMode();
}
}
}
@@ -179,7 +181,9 @@ class appUserPreferences extends DBObject
$oObj->Set('preferences', array()); // Default preferences: an empty array
try
{
utils::PushArchiveMode(false);
$oObj->DBInsert();
utils::PopArchiveMode();
}
catch(Exception $e)
{
@@ -214,7 +218,8 @@ class appUserPreferences extends DBObject
*/
public function DBDeleteTracked(CMDBChange $oChange, $bSkipStrongSecurity = null, &$oDeletionPlan = null)
{
utils::PushArchiveMode(false);
$this->DBDelete($oDeletionPlan);
utils::PopArchiveMode();
}
}
?>

View File

@@ -344,7 +344,9 @@ try
$sLangCode = utils::ReadParam('language', 'EN US');
$oUser = UserRights::GetUserObject();
$oUser->Set('language', $sLangCode);
utils::PushArchiveMode(false);
$oUser->DBUpdate();
utils::PopArchiveMode();
// Redirect to force a reload/display of the page with the new language
$oAppContext = new ApplicationContext();
$sURL = utils::GetAbsoluteUrlAppRoot().'pages/preferences.php?'.$oAppContext->GetForLink();
@@ -423,4 +425,3 @@ catch(Exception $e)
IssueLog::Error($e->getMessage());
}
}
?>