You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I remove a locale of an article programmatically, the ArticleIndexer will throw an error:
at /var/www/sulu/vendor/sulu/article-bundle/Document/Index/ArticleIndexer.php:294
Sulu\Bundle\ArticleBundle\Document\Index\ArticleIndexer->getBlockContentFieldsRecursive() at /var/www/sulu/vendor/sulu/article-bundle/Document/Index/ArticleIndexer.php:279
Sulu\Bundle\ArticleBundle\Document\Index\ArticleIndexer->getContentFields() at /var/www/sulu/vendor/sulu/article-bundle/Document/Index/ArticleIndexer.php:245
Sulu\Bundle\ArticleBundle\Document\Index\ArticleIndexer->createOrUpdateArticle() at /var/www/sulu/vendor/sulu/article-bundle/Document/Index/ArticleIndexer.php:440
Sulu\Bundle\ArticleBundle\Document\Index\ArticleIndexer->removeLocale() at /var/www/sulu/vendor/sulu/article-bundle/Document/Subscriber/ArticleSubscriber.php:471
Sulu\Bundle\ArticleBundle\Document\Subscriber\ArticleSubscriber->handleRemoveLocale() at /var/www/sulu/vendor/symfony/event-dispatcher/EventDispatcher.php:230
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() at /var/www/sulu/vendor/symfony/event-dispatcher/EventDispatcher.php:59
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /var/www/sulu/vendor/sulu/sulu/src/Sulu/Component/DocumentManager/DocumentManager.php:70
Sulu\Component\DocumentManager\DocumentManager->removeLocale() at
Expected Behavior
removeLocale will run as expected
Steps to Reproduce
The behaviour is strange and difficult to explain. For a particular article, I can't remove the locale because of this error.
It happens in $contentFields = array_merge($contentFields, $this->getBlockContentFieldsRecursive($blocks, $document, $property, $tag)); of getContentFields() in Document/Index/ArticleIndexer.php
$blocks is null and it will throw an error, but it in my opinion $blocks should be [].
The block property which gives a null value does not appear in the according XML content in the phpcr_nodes table. What could be the problem here? Its confusing, because If I add a new article without setting this block property (and the property does not appear in the XML content as well), the locale can be removed without any error.
Possible Solutions
Maybe add an if in getContentFields()-Method?
if ($blocks === null) {
$blocks = [];
}
If I add the if block, the locale can be removed without any error.
The text was updated successfully, but these errors were encountered:
Actual Behavior
When I remove a locale of an article programmatically, the ArticleIndexer will throw an error:
Expected Behavior
removeLocale will run as expected
Steps to Reproduce
The behaviour is strange and difficult to explain. For a particular article, I can't remove the locale because of this error.
It happens in
$contentFields = array_merge($contentFields, $this->getBlockContentFieldsRecursive($blocks, $document, $property, $tag));
ofgetContentFields()
inDocument/Index/ArticleIndexer.php
$blocks
isnull
and it will throw an error, but it in my opinion$blocks
should be[]
.The block property which gives a null value does not appear in the according XML content in the
phpcr_nodes
table. What could be the problem here? Its confusing, because If I add a new article without setting this block property (and the property does not appear in the XML content as well), the locale can be removed without any error.Possible Solutions
Maybe add an if in
getContentFields()
-Method?If I add the if block, the locale can be removed without any error.
The text was updated successfully, but these errors were encountered: