• 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

Jake Bunce

XenForo moderator
Staff member
#1
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));
	}
 

Mike

XenForo developer
Staff member
#2
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).