From 94c70524820a51bc34a1539a93cd6bbb4bc31193 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 13 Jul 2018 11:41:53 +0200 Subject: [PATCH] allow 'note' to be null Signed-off-by: Bjoern Schiessle --- core/Migrations/Version14000Date20180712153140.php | 6 ++---- lib/private/Share20/Share.php | 5 ++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/Migrations/Version14000Date20180712153140.php b/core/Migrations/Version14000Date20180712153140.php index 04e682a4f68..7f667fa3847 100644 --- a/core/Migrations/Version14000Date20180712153140.php +++ b/core/Migrations/Version14000Date20180712153140.php @@ -21,6 +21,7 @@ namespace OC\Core\Migrations; +use OCP\DB\ISchemaWrapper; use OCP\Migration\SimpleMigrationStep; /** @@ -35,10 +36,7 @@ class Version14000Date20180712153140 extends SimpleMigrationStep { $schema = $schemaClosure(); $table = $schema->getTable('share'); - $table->addColumn('note', 'text', [ - 'notnull' => true, - 'default' => '' - ]); + $table->addColumn('note', 'text'); return $schema; } diff --git a/lib/private/Share20/Share.php b/lib/private/Share20/Share.php index 73373c7823d..e54497c9b55 100644 --- a/lib/private/Share20/Share.php +++ b/lib/private/Share20/Share.php @@ -322,7 +322,10 @@ class Share implements \OCP\Share\IShare { * @inheritdoc */ public function getNote() { - return $this->note; + if (is_string($this->note)) { + return $this->note; + } + return ''; } /**