[Duplicate] Error when remove with soft delete and see as registered user
#1
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
The only infinite thing is the universe and human stupidity, but the universe is not for sure

Plugins 1.6.x

Plugins 1.8.x

Reply
#2
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.
My Projects - Support My Projects

Don't forget to rate posts!
Reply
#3
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
The only infinite thing is the universe and human stupidity, but the universe is not for sure

Plugins 1.6.x

Plugins 1.8.x

Reply
#4
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))
My Projects - Support My Projects

Don't forget to rate posts!
Reply
#5
OK, can you make a PR?
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#6
Done.
https://github.com/mybb/mybb/pull/2969
My Projects - Support My Projects

Don't forget to rate posts!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)