Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/src/Controller/EmailAddressesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public function forceVerify(string $id) {
$this->Flash->error($e->getMessage());
}

return $this->generateRedirect(null);
// return the email entity back to the view
$obj = $this->EmailAddresses->get((int)$id);
return $this->generateRedirect($obj);
}
}
2 changes: 1 addition & 1 deletion app/src/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public function generateRedirect($entity) {
return $this->redirect(['action' => 'deleted']);
} elseif($redirectGoal == 'self'
&& $entity
&& in_array($this->request->getParam('action'), ['add', 'copy', 'edit', 'unfreeze'])) {
&& in_array($this->request->getParam('action'), ['add', 'copy', 'edit', 'unfreeze', 'forceVerify'])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike the other actions, forceVerify is specific to EmailAddress and so probably shouldn't be hardcoded into this list.

We probably need something like PrimaryLinkTrait's allowLookupPrimaryLink(), etc, except this probably belongs in TableMetaTrait instead. It should default to the four standard actions, then EmailAddressesTable could add forceVerify as an approved action via getSelfRedirectGoals() or whatever.

// We typically want to redirect to the edit view of the record,
// but in some cases (eg: if the record was just frozen) we want to
// redirect to "view" instead.
Expand Down