Skip to content

Commit

Permalink
Merge pull request #5516 in SW/shopware from sw-19822/5.3/fix-account…
Browse files Browse the repository at this point in the history
…-error-when-user-not-found to 5.3

* commit '71c189235f0349ca3e73b1514e709d63aad25edc':
  SW-19822 - Improve error message when account could not be found
  SW-19822 - Fix account error when user couldn't be found
  • Loading branch information
soebbing committed Sep 22, 2017
2 parents 4cbbd78 + 71c1892 commit cff5fc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions engine/Shopware/Controllers/Frontend/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,14 @@ private function getCustomerByResetHash($hash)
}

/** @var $customer Customer */
$customer = $this->get('models')->find('Shopware\Models\Customer\Customer', $confirmModel->getData());
$customer = $this->get('models')->find(\Shopware\Models\Customer\Customer::class, $confirmModel->getData());
if (!$customer) {
throw new Exception($resetPasswordNamespace->get(
sprintf('PasswordResetNewMissingId', $confirmModel->getData()),
sprintf('Could not find the user with the ID "%s".', $confirmModel->getData())
));
throw new Exception(
$resetPasswordNamespace->get(
'PasswordResetNewMissingId',
'Your account could not be found. Please contact us to fix this problem.'
)
);
}

return $customer;
Expand Down
6 changes: 3 additions & 3 deletions snippets/frontend/account/reset_password.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
PasswordResetNewHeadline = "Specify a new passowrd"
PasswordResetNewHelpText = "If you have forgotten your account's password, you can now set a new one. Once you save your new password, your old password will no longer be valid"
PasswordResetNewLinkError = "Confirmation link not found. Note that the confirmation link is only valid for 2 hours. After that you have to request a new confirmation link."
PasswordResetNewMissingId = "Could not find the user with the ID \"%s\"."
PasswordResetNewMissingId = "Your account could not be found. Please contact us to fix this problem."
PasswordResetNewSuccess = "Your password has been changed successfully."

[de_DE]
PasswordResetNewHeadline = "Ein neues Passwort definieren"
PasswordResetNewHelpText = "Wenn Sie das Passwort für Ihr Konto vergessen haben, können Sie hier ein neues definieren. Wenn Sie das neue Passwort speichern, wird Ihr altes Passwort ungültig."
PasswordResetNewLinkError = "Bestätigungslink nicht gefunden. Bedenken Sie, dass der Bestätigungslink nur 2 Stunden gültig ist. Danach müssen Sie sich einen neuen Bestätigungslink zusenden lassen."
PasswordResetNewMissingId = "Konnte den Benutzer mit der ID \"%s\" nicht finden."
PasswordResetNewSuccess = "Ihr Passwort wurde erfolgreich geändert."
PasswordResetNewMissingId = "Ihr Kundenkonto konnte nicht gefunden werden, bitte kontaktieren Sie uns, um dieses Problem zu lösen."
PasswordResetNewSuccess = "Ihr Passwort wurde erfolgreich geändert."

0 comments on commit cff5fc7

Please sign in to comment.