Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-8241

Prune / Auto-Prune deletes new topics not yet viewed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • 3.0.4
    • 3.0.5
    • Other
    • None
    • PHP Environment:
      Database:

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: