As designed Redundant code

Robbo

Well-known member
I spotted this code in the DiscussionMessage datawriter. Looks like code that was added before the data writer supported default values.

Line 310:
PHP:
		if ($this->isInsert() && !$this->isChanged('message_state'))
		{
			$this->set('message_state', 'visible');
		}
		if ($this->isInsert() && !$this->isChanged('post_date'))
		{
			$this->set('post_date', XenForo_Application::$time);
		}
 
It's more to ensure that the values are there in preSave, in case something actually works on them, though they probably aren't particularly significant.
 
Top Bottom