diff --git a/src/Command/MigrateDataCommand.php b/src/Command/MigrateDataCommand.php index 9070355..8afd346 100644 --- a/src/Command/MigrateDataCommand.php +++ b/src/Command/MigrateDataCommand.php @@ -41,7 +41,15 @@ class MigrateDataCommand extends Command foreach ($this->postRepo->create()->find() as $post) { $tags = $post->getTags(); - $post->setTags($tags); + $newTags = []; + + foreach ($tags as $k => $v) { + if (!empty($v['label'])) { + $newTags[] = $v; + } + } + + $post->setTags($newTags); $this->entityManager->update($post); } diff --git a/templates/blog/post/post.html.twig b/templates/blog/post/post.html.twig index 3b2a631..04cb33a 100644 --- a/templates/blog/post/post.html.twig +++ b/templates/blog/post/post.html.twig @@ -25,8 +25,8 @@ {% for tag in post.tags %}
  • - - {{- '#' ~ tag.value -}} + + {{- '#' ~ tag.label -}}
  • {% endfor %}