fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
462 stars 299 forks source link

Deleting the current item should lead back to the last valid page, e.g. a list of items #5001

Open olivertwistor opened 3 months ago

olivertwistor commented 3 months ago

Webtrees version: 2.1.20

When a user views an item page (e.g. a person), opens the Edit dropdown menu and chooses Delete (I use a translated Webtrees, so it might be named something else like Remove), the item is removed, but instead of landing on a valid page (e.g. a list of persons), the user remains on the same item page, which doesn't exist anymore and the user will get an error message. This is misleading because the user might think they have been logged out or there is something wrong with their user permissions (because of the broad error message, see Actual behaviour).

Steps to reproduce

  1. Create a new tree.
  2. Create a new person.
  3. Go to that person's item page (index.php?route=/.../individual/...)
  4. In the Edit dropdown, choose Delete to delete the person. Confirm the choice.

Actual behaviour

The page the user lands on is showing an error message that says that this person doesn't exist anymore or the user lacks permission to view the page.

Expected behaviour

The page the user lands on should be a list of persons, or the last viewed person (connected to the deleted person or not), or the home page.