When cloning TextContent, include model
authorYuri Astrakhan <yurik@wikimedia.org>
Tue, 16 Sep 2014 06:58:36 +0000 (02:58 -0400)
committerYuri Astrakhan <yurik@wikimedia.org>
Tue, 16 Sep 2014 06:58:36 +0000 (02:58 -0400)
The model id should be preserved when cloning values
on save.

Change-Id: I397d36af30cf1401023b761e8c41f0dc83e76c12

includes/content/TextContent.php

index d292880..c479f20 100644 (file)
@@ -160,7 +160,7 @@ class TextContent extends AbstractContent {
                $text = $this->getNativeData();
                $pst = rtrim( $text );
 
-               return ( $text === $pst ) ? $this : new static( $pst );
+               return ( $text === $pst ) ? $this : new static( $pst, $this->getModel() );
        }
 
        /**