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

As Designed Redundant code

Discussion in 'Resolved Bug Reports' started by Robbo, Oct 23, 2012.

  1. Robbo

    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);
            }
     
    Marcus likes this.
  2. Mike

    Mike 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.
     
    Slavik likes this.

Share This Page