Fork me on GitHub
Subscribe 2

Ticket #148 (fixed enhancement)

Redirection after deleting a message

  • Created: 2010-09-29 18:08:56
  • Reported by: Fran├žois
  • Assigned to: Reines
  • Milestone: 1.4.3
  • Component: usability
  • Priority: normal

Why are we redirected to first page of the topic when we delete a message, instead of coming back where we were ?

If we don't note a which page we are, especially in big topic, it's difficult to find from where we were.

We can easily change this : search in the delete.php file, line 70

redirect('viewtopic.php?id='.$cur_post['tid'], $lang_delete['Post del redirect']);

Replace by

// Redirect towards the previous post
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' AND id < '.$id.' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
$post_id = $db->result($result);

redirect('viewtopic.php?pid='.$post_id.'#p'.$post_id, $lang_delete['Post del redirect']);

History

Fran├žois 2010-09-29 18:11:34

  • Type changed from bug to enhancement.

Reines 2010-09-30 15:58:56

  • Milestone set to 1.4.3.
  • Owner set to Reines.

I think this is a sensible idea, and has very little cost (unless you have a board where people delete posts 24/7, but even then it's minor).

I'll mark it for the 1.4.3 release, unless anyone has any objections.

Reines 2010-10-01 09:03:26

Added in ba02891d4c6ac86ab33d. Cheers.

PS. Not tested at all yet! Will do when I get home from work unless anyone else wants to first...

Reines 2010-10-01 09:04:31

I wonder if it would be worth trying to do a similar thing when deleting topics, by redirecting to the page of the previous topic rather than first page of viewforum.

Reines 2010-10-01 17:11:22

  • Status changed from open to fixed.