1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

As Designed edit history pruning disabled = all history pruned

Discussion in 'Resolved Bug Reports' started by Jake Bunce, Oct 28, 2013.

  1. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    XenForo_Model_EditHistory

    Add red code:

    Code:
    	public function pruneEditHistory($cutOff = null)
    	{
    		if ($cutOff === null)
    		{
    			if (XenForo_Application::get('options')->editHistory['enabled'])
    			{
    				$logLength = XenForo_Application::get('options')->editHistory['length'];
    				if (!$logLength)
    				{
    					return 0;
    				}
    			}
    			else
    			{
    				// $logLength = 0;
    				return 0;
    			}
    
    			$cutOff = XenForo_Application::$time - 86400 * $logLength;
    		}
    
    		$db = $this->_getDb();
    		return $db->delete('xf_edit_history', 'edit_date < ' . $db->quote($cutOff));
    	}
    
     
    Amaury likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    The else case there refers to edit history being disabled (the check box being unchecked) so deleting the existing history information is the expected case.

    To never prune the data, the check box must be checked and the prune time set to 0 (mentioned in the option description).
     
    Adam Howard likes this.

Share This Page