Skip to content
This repository was archived by the owner on Jul 13, 2021. It is now read-only.

Commit 866821c

Browse files
David TischmacherLaurentGruber
David Tischmacher
authored andcommitted
[BlogBundle] Fix blog tags import (#2441)
* Fix blog tags import * Fix travis errors
1 parent b559d88 commit 866821c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugin/blog/Manager/BlogManager.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public function importBlog(array $data, $rootPath, User $owner)
207207
->setPublicationDate(new \DateTime($postsData['publication_date']))
208208
->setStatus($commentsData['status'])
209209
;
210+
$this->objectManager->persist($comment);
210211
$comments->add($comment);
211212
}
212213

@@ -291,7 +292,7 @@ private function getTagScheduledForInsert($name)
291292

292293
foreach ($scheduledForInsert as $entity) {
293294
if (get_class($entity) === 'Icap\BlogBundle\Entity\Tag') {
294-
if ($entity->getName() === $name) {
295+
if (strtoupper(iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $entity->getName())) === strtoupper(iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $name))) {
295296
return $entity;
296297
}
297298
}
@@ -310,7 +311,7 @@ private function getTagFromIdentityMap($name)
310311

311312
//so it was in the identityMap hey !
312313
foreach ($map['Icap\BlogBundle\Entity\Tag'] as $tag) {
313-
if ($tag->getName() === $name) {
314+
if (strtoupper(iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $tag->getName())) === strtoupper(iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $name))) {
314315
return $tag;
315316
}
316317
}

0 commit comments

Comments
 (0)