fix tags
This commit is contained in:
parent
04662fac05
commit
6cf38a56cb
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
{% for tag in post.tags %}
|
||||
<li>
|
||||
<a href="{{ safe_path('blog_menu_search', {tag: tag.value}) }}">
|
||||
{{- '#' ~ tag.value -}}
|
||||
<a href="{{ safe_path('blog_menu_search', {tag: tag.label}) }}">
|
||||
{{- '#' ~ tag.label -}}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue