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

As designed Redundant code


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:
		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);


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