MyBB Community Forums
[Duplicate] Error when remove with soft delete and see as registered user - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Rejected (https://community.mybb.com/forum-184.html)
+----- Thread: [Duplicate] Error when remove with soft delete and see as registered user (/thread-215175.html)



Error when remove with soft delete and see as registered user - Whiteneo - 2018-01-04

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


RE: Error when remove with soft delete and see as registered user - chack1172 - 2018-01-04

Yeah, I confirm it.
The problem is in this condition:
https://github.com/mybb/mybb/blob/feature/showthread.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.


RE: Error when remove with soft delete and see as registered user - Whiteneo - 2018-01-04

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


RE: Error when remove with soft delete and see as registered user - chack1172 - 2018-01-04

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))



RE: Error when remove with soft delete and see as registered user - Eldenroot - 2018-01-05

OK, can you make a PR?


RE: Error when remove with soft delete and see as registered user - chack1172 - 2018-01-05

Done.
https://github.com/mybb/mybb/pull/2969