As designed edit history pruning disabled = all history pruned

Jake Bunce

Well-known member
XenForo_Model_EditHistory

Add red code:

Rich (BB 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));
	}
 
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).
 
Top Bottom