After deleting an internal message (either a received or sent message) in fullveiw page, it will be forwarded to home page instead of message received or sent page.
The root cause is, in /actions/messages/delete.php, it use "forward(REFERER);" at the end. But now that the message has been deleted, its original fullview page won't exist, so Elgg will forward to default home page.
To fix:
1. in /mod/messages/views/default/object/messages.php, add a variable to indicate it's a sent or received message, $sendreceive = "inbox"; or $sendreceive = "sent";. Then add $sendreceive in $delete_link as following:
$delete_link = elgg_view("output/confirmlink", array(
'href' => "action/messages/delete?guid=" . $message->getGUID() . "&mtype=" . $sendreceive,
'text' => "<span class=\"elgg-icon elgg-icon-delete float-alt\"></span>",
'confirm' => elgg_echo('deleteconfirm'),
'encode_text' => false,
));
2. in /mod/messages/actions/messages/delete.php, get $mtype = get_input('mtype','inbox'); then change the last forward statement to following:
//forward(REFERER);
forward("messages/{$mtype}/" . elgg_get_logged_in_user_entity()->username);
I think this is a bug. Mine is Elgg 1.8.5, but the source code doesn't change in Elgg 1.8.14.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Matt Beckett@Beck24

Matt Beckett - 0 likes
- Thuvalpakshi@thuvalpakshi

Thuvalpakshi - 0 likes
You must log in to post replies.Excellent!
https://github.com/Elgg/Elgg - lodge an issue, or better yet, a pull request!
after deleting a full view message its redirection to the inbox.. i think it should be like that only insted of redirecting to activity page... (if its so user need to again click on the message icon then choose the message to read ...> then delete > gone to activity > click on message > again click on message > read and delete.. hetic)