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

As designed Redundant code

Robbo

Well-known member
#1
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);
		}
 

Mike

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