diff --git a/src/Model/Entity/Panel.php b/src/Model/Entity/Panel.php index 634a1cf4b..03312d8cd 100644 --- a/src/Model/Entity/Panel.php +++ b/src/Model/Entity/Panel.php @@ -25,4 +25,20 @@ class Panel extends Entity * @var array */ protected $_hidden = ['content']; + + /** + * Read the stream contents. + * + * Over certain sizes PDO will return file handles. + * For backwards compatibility and consistency we smooth over that difference here. + * + * @return string + */ + protected function _getContent($content) + { + if (is_resource($content)) { + return stream_get_contents($content); + } + return $content; + } } diff --git a/tests/Fixture/PanelsFixture.php b/tests/Fixture/PanelsFixture.php index ef4e76b3e..1230163a7 100644 --- a/tests/Fixture/PanelsFixture.php +++ b/tests/Fixture/PanelsFixture.php @@ -33,7 +33,7 @@ class PanelsFixture extends TestFixture 'title' => ['type' => 'string'], 'element' => ['type' => 'string'], 'summary' => ['type' => 'string'], - 'content' => ['type' => 'text'], + 'content' => ['type' => 'binary'], '_constraints' => [ 'primary' => ['type' => 'primary', 'columns' => ['id']], 'unique_panel' => ['type' => 'unique', 'columns' => ['request_id', 'panel']],