Skip to content

Commit 18b3e85

Browse files
author
Leny BERNARD
committed
Merge pull request #216 from Charlie-Lucas/master
allow date widget to display article and fix seo update
2 parents 43f310d + 7db9b6b commit 18b3e85

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Bundle/BlogBundle/Entity/Article.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* @ORM\Entity(repositoryClass="Victoire\Bundle\BlogBundle\Repository\ArticleRepository"))
1616
* @ORM\Table("vic_article")
17-
* @VIC\BusinessEntity({"Force", "Redactor", "Listing", "BlogArticles", "Title", "CKEditor", "Text", "UnderlineTitle", "Cover", "Image", "Authorship", "ArticleList"})
17+
* @VIC\BusinessEntity({"Date", "Force", "Redactor", "Listing", "BlogArticles", "Title", "CKEditor", "Text", "UnderlineTitle", "Cover", "Image", "Authorship", "ArticleList"})
1818
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
1919
*/
2020
class Article

Bundle/SeoBundle/Helper/PageSeoHelper.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,16 @@ public function updateSeoByEntity(BasePage $page, $entity)
8888
foreach ($businessProperties as $businessProperty) {
8989
//parse of seo attributes
9090
foreach ($this->pageSeoAttributes as $seoAttribute) {
91-
$string = $this->getEntityAttributeValue($pageSeo, $seoAttribute);
92-
$updatedString = $this->parameterConverter->setBusinessPropertyInstance($string, $businessProperty, $entity);
93-
$this->setEntityAttributeValue($pageSeo, $seoAttribute, $updatedString);
91+
$value = $this->getEntityAttributeValue($pageSeo, $seoAttribute);
92+
// we only update value if its a string and (if its a VBP or its a BP where value is not defined)
93+
if (is_string($value) && ($page instanceof VirtualBusinessPage || $page instanceof BusinessPage && $value == null )) {
94+
$value = $this->parameterConverter->setBusinessPropertyInstance(
95+
$value,
96+
$businessProperty,
97+
$entity
98+
);
99+
}
100+
$this->setEntityAttributeValue($pageSeo, $seoAttribute, $value);
94101
}
95102
}
96103
}

0 commit comments

Comments
 (0)