diff --git a/src/ContentMigrator.php b/src/ContentMigrator.php index 7621785..ce1fec2 100644 --- a/src/ContentMigrator.php +++ b/src/ContentMigrator.php @@ -346,6 +346,13 @@ protected function migrateReplicatorSet($set, $fieldConfigs) */ protected function migrateBardField($handle, $value, $config) { + // If content was saved while bard had no sets, value may be a string, so we'll normalize to a bard text set... + if (is_string($value)) { + $value = [ + ['type' => 'text', 'text' => $value], + ]; + } + return $this->migrateReplicatorField($handle, $value, $config); } diff --git a/tests/ContentMigratorTest.php b/tests/ContentMigratorTest.php index 794bea2..52bac16 100644 --- a/tests/ContentMigratorTest.php +++ b/tests/ContentMigratorTest.php @@ -620,7 +620,9 @@ public function it_can_migrate_bards_with_no_sets() ]); $expected = [ - 'some_bard' => 'Well hello there!', + 'some_bard' => [ + ['type' => 'text', 'text' => 'Well hello there!'], + ], 'blueprint' => 'speaker', ];