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)
|
foreach ($this->postRepo->create()->find() as $post)
|
||||||
{
|
{
|
||||||
$tags = $post->getTags();
|
$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);
|
$this->entityManager->update($post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
{% for tag in post.tags %}
|
{% for tag in post.tags %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ safe_path('blog_menu_search', {tag: tag.value}) }}">
|
<a href="{{ safe_path('blog_menu_search', {tag: tag.label}) }}">
|
||||||
{{- '#' ~ tag.value -}}
|
{{- '#' ~ tag.label -}}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue