Customer portal : Fixed regression introduced by r4159. Preferences form in user profile was crashing.

SVN:trunk[4166]
This commit is contained in:
Guillaume Lajarige
2016-06-01 15:51:29 +00:00
parent 1fb346da67
commit d026c86c50

View File

@@ -61,6 +61,10 @@ class UserProfileBrickController extends BrickController
$aData = array();
// Setting form mode regarding the demo mode parameter
$bDemoMode = MetaModel::GetConfig()->Get('demo_mode');
$sFormMode = ($bDemoMode) ? ObjectController::ENUM_MODE_VIEW : ObjectController::ENUM_MODE_EDIT;
// If this is ajax call, we are just submiting preferences or password forms
if ($oRequest->isXmlHttpRequest())
{
@@ -68,7 +72,7 @@ class UserProfileBrickController extends BrickController
$sFormType = $aCurrentValues['form_type'];
if ($sFormType === PreferencesFormManager::FORM_TYPE)
{
$aData['form'] = $this->HandlePreferencesForm($oRequest, $oApp);
$aData['form'] = $this->HandlePreferencesForm($oRequest, $oApp, $sFormMode);
}
elseif ($sFormType === PasswordFormManager::FORM_TYPE)
{
@@ -88,10 +92,6 @@ class UserProfileBrickController extends BrickController
$sCurContactClass = get_class($oCurContact);
$sCurContactId = $oCurContact->GetKey();
// Setting form mode regarding the demo mode parameter
$bDemoMode = MetaModel::GetConfig()->Get('demo_mode');
$sFormMode = ($bDemoMode) ? ObjectController::ENUM_MODE_VIEW : ObjectController::ENUM_MODE_EDIT;
// Preparing forms
$aData['forms']['contact'] = ObjectController::HandleForm($oRequest, $oApp, $sFormMode, $sCurContactClass, $sCurContactId, $oBrick->GetForm());
$aData['forms']['preferences'] = $this->HandlePreferencesForm($oRequest, $oApp, $sFormMode);