mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fixes a bug when editing My Account
This commit is contained in:
parent
3e2755f297
commit
b121e03608
@ -137,9 +137,9 @@ class FormController extends ControllerBehavior
|
||||
* Ajax handler for saving from the creation form.
|
||||
* @return mixed
|
||||
*/
|
||||
public function create_onSave()
|
||||
public function create_onSave($context = null)
|
||||
{
|
||||
$this->context = $this->getConfig('update[context]', 'create');
|
||||
$this->context = strlen($context) ? $context : $this->getConfig('create[context]', 'create');
|
||||
$model = $this->controller->formCreateModelObject();
|
||||
$this->initForm($model);
|
||||
|
||||
@ -190,9 +190,9 @@ class FormController extends ControllerBehavior
|
||||
* @param int $recordId The model primary key to update.
|
||||
* @return mixed
|
||||
*/
|
||||
public function update_onSave($recordId = null)
|
||||
public function update_onSave($recordId = null, $context = null)
|
||||
{
|
||||
$this->context = $this->getConfig('update[context]', 'update');
|
||||
$this->context = strlen($context) ? $context : $this->getConfig('update[context]', 'update');
|
||||
$model = $this->controller->formFindModelObject($recordId);
|
||||
$this->initForm($model);
|
||||
|
||||
@ -259,7 +259,6 @@ class FormController extends ControllerBehavior
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Utils
|
||||
//
|
||||
@ -596,5 +595,4 @@ class FormController extends ControllerBehavior
|
||||
$model->{$attribute} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class Users extends Controller
|
||||
*/
|
||||
public function myaccount_onSave()
|
||||
{
|
||||
$result = $this->getClassExtension('Backend.Behaviors.FormController')->update_onSave($this->user->id);
|
||||
$result = $this->getClassExtension('Backend.Behaviors.FormController')->update_onSave($this->user->id, 'mysettings');
|
||||
|
||||
/*
|
||||
* If the password or login name has been updated, reauthenticate the user
|
||||
|
Loading…
x
Reference in New Issue
Block a user