Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-8241

Prune / Auto-Prune deletes new topics not yet viewed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.5
    • 3.0.4
    • Other
    • None
    • PHP Environment:
      Database:

      If you create a topic without viewing it and the auto-prune kicks in or you trigger a prune from the administration the new topic gets deleted immediately.

      This seems to be caused because topic_last_view_time seems to be initialized with 0 when the topic is created.

      My quick fix to this problem is to replace in functions_admin.php

      	if ($prune_mode == 'viewed')
      	{
      		$sql_and .= " AND topic_last_view_time < $prune_date";
      	}

      with:

      	if ($prune_mode == 'viewed')
      	{
      		$sql_and .= " AND topic_last_view_time > 0";
      		$sql_and .= " AND topic_last_view_time < $prune_date";
      	}

      If you create a topic without viewing it and the auto-prune kicks in or you trigger a prune from the administration the new topic gets deleted immediately.

      This seems to be caused because topic_last_view_time seems to be initialized with 0 when the topic is created.

      My quick fix to this problem is to replace in functions_admin.php

      	if ($prune_mode == 'viewed')
      	{
      		$sql_and .= " AND topic_last_view_time < $prune_date";
      	}

      with:

      	if ($prune_mode == 'viewed')
      	{
      		$sql_and .= " AND topic_last_view_time > 0";
      		$sql_and .= " AND topic_last_view_time < $prune_date";
      	}

      Bug #16565 seems to be related to this. But my forum was never converted.

      Gregor seems to be related to this. But my forum was never converted.

      Gregor

            Acyd Burn Meik Sievertsen [X] (Inactive)
            gregork gregork
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: