Skip to content

Commit

Permalink
Fix to change password form on account page
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Guinn authored and bummzack committed Jul 6, 2016
1 parent d3a0934 commit 0233505
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions code/account/AccountPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,17 @@ public function EditAccountForm()

public function ChangePasswordForm()
{
/** @var ChangePasswordForm $form */
$form = ChangePasswordForm::create($this, "ChangePasswordForm");

// The default form tries to redirect to /account/login which doesn't exist
$backURL = $form->Fields()->fieldByName('BackURL');
if (!$backURL) {
$backURL = new HiddenField('BackURL', 'BackURL');
$form->Fields()->push($backURL);
}
$backURL->setValue($this->Link('editprofile'));

$this->extend('updateChangePasswordForm', $form);
$this->data()->extend('updateChangePasswordForm', $form);

Expand Down

0 comments on commit 0233505

Please sign in to comment.