2009-08-06, 11:43 PM
If you delete multiple posts using "Inline Post Moderation" then any reported posts are not marked as reportstatus 0.
If you delete a single post using "Inline Post Moderation" then the report is properly marked as reportstatus 0.
To replicate:
1. Find a thread with more than 2 posts.
2. Report post #2.
3. Using "Inline Post Moderation" delete posts #2 and #3.
4. View reported posts and see the deleted post still there with no info
To View Normal behavior:
1. Find a thread with more than 2 posts.
2. Report post #2.
3. Using "Inline Post Moderation" delete post #2
4. View reported posts and see it's marked
Problem:
moderation.php
Seems a logic problem. Whatever the solution you choose there is a small bug here.
If you delete a single post using "Inline Post Moderation" then the report is properly marked as reportstatus 0.
To replicate:
1. Find a thread with more than 2 posts.
2. Report post #2.
3. Using "Inline Post Moderation" delete posts #2 and #3.
4. View reported posts and see the deleted post still there with no info
To View Normal behavior:
1. Find a thread with more than 2 posts.
2. Report post #2.
3. Using "Inline Post Moderation" delete post #2
4. View reported posts and see it's marked
Problem:
moderation.php
case "do_multideleteposts":
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);
$postlist = explode("|", $mybb->input['posts']);
if(!is_moderator_by_pids($postlist, "candeleteposts"))
{
error_no_permission();
}
$postlist = array_map('intval', $postlist);
$pids = implode(',', $postlist);
$tids = array();
if($pids)
{
$query = $db->simple_select("threads", "tid", "firstpost IN({$pids})");
while($tid = $db->fetch_field($query, "tid"))
{
$tids[] = $tid;
}
}
$deletecount = 0;
foreach($postlist as $pid)
{
$pid = intval($pid);
$moderation->delete_post($pid);
$plist[] = $pid;
$deletecount++;
}
// If we have multiple threads, we must be coming from the search
if(!empty($tids))
{
foreach($tids as $tid)
{
$moderation->delete_thread($tid);
mark_reports($tid, "thread");
$url = get_forum_link($fid);
}
}
// Otherwise we're just deleting from showthread.php
else
{
$query = $db->simple_select("posts", "*", "tid='$tid'");
$numposts = $db->num_rows($query);
if(!$numposts)
{
$moderation->delete_thread($tid);
mark_reports($tid, "thread");
$url = get_forum_link($fid);
}
else
{
mark_reports($plist, "posts");
$url = get_thread_link($thread['tid']);
}
}
$lang->deleted_selective_posts = $lang->sprintf($lang->deleted_selective_posts, $deletecount);
log_moderator_action($modlogdata, $lang->deleted_selective_posts);
moderation_redirect($url, $lang->redirect_postsdeleted);
break;
Seems a logic problem. Whatever the solution you choose there is a small bug here.