MyBB Community Forums

Full Version: Error when remove with soft delete and see as registered user
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I saw an error today when i have removed a post with soft delete. If this is the last post.

Then enter as non mod permissions in that thread and allways you must see a popup error with the post id invalid.

So i think this is posible a bug.

And in jgrowl error lightred color does not exist, can you use another color like lightsalmon.

I think this is a minor related issue but anyway is a posible issue.

Thanks in advance.

I forgot this is related to major 1.8.14 mybb version
Yeah, I confirm it.
The problem is in this condition:
https://github.com/mybb/mybb/blob/featur...d.php#L927
if(empty($post) || ($post['visible'] == 0 && !is_moderator($post['fid'], 'canviewunapprove')) || ($post['visible'] == -1 && !is_moderator($post['fid'], 'canviewdeleted')))

There should be another condition to check if usergroup can see deleted posts. And when you go to a thread and there is action=lastpost in the query, it should only go to the last active post.
I think if that code parses the input like

&& ( $mybb->input['action'] != "lastpost" )

Maybe should help if not is a visible thread as lastpost but dunno only i can supose that Smile
action=lastpost is removed because there is a redirect, so you cannot add the condition.

I'll change the condition with this:
if(empty($post) || ($post['visible'] == 0 && !is_moderator($post['fid'], 'canviewunapprove')) || ($post['visible'] == -1 && !is_moderator($post['fid'], 'canviewdeleted') && $forumpermissions['canviewdeletionnotice'] == 0))
OK, can you make a PR?