sulu / SuluArticleBundle

Bundle for managing localized content-rich entities like blog-posts in the Sulu content management system
MIT License
57 stars 77 forks source link

RoutePath not saved with articles #593

Closed speex404 closed 3 years ago

speex404 commented 3 years ago
Q A
Bug? yes
New Feature? no
SuluArticleBundle Version 2.3.1
Sulu Version 2.3.1, 2.3.2
PHP Version 8.0.9
Elasticsearch 7.14.0
DB Version MySQL 8.0.23
Browser Version Chromium 92.0.4515

Actual Behavior

After reindexing the articles the frontend crashes for articles where no resourcelocator was set.

Sulu\Bundle\ArticleBundle\Content\ArticleResourceItem::getRoutePath(): Return value must be of type string, null returned

Expected Behavior

A reindex should not affect the resource locator.

Steps to Reproduce

Furthermore

The PHPCR node properties differ between the live and the default version. Among other things there is no routePath property in the subset of the live session.

To reproduce this:

niklasnatter commented 3 years ago

Hey, thanks for writing this up!

Unfortunately I cannot find the time to investigate this at the moment. I hope to be able to have a look at it in the next two weeks 🙂

niklasnatter commented 3 years ago

I found some time to investigate this and create a PR to write the routePath to the correct session (https://github.com/sulu/sulu/pull/6210) 🙂

For completion, this bug only happens when creating and publishing an article in the same step via the Save and publish toolbar action. It does not occur when publishing an existing article. Also, the bug disappears if the article is published a second time. The reason for this is that the StructureSubscriber::mapContentToNode method will set the property when the form contains a value for the route path.

rogamoore commented 3 years ago

Hey @nnatter, that's great news - thank you very much :)

alexander-schranz commented 3 years ago

https://github.com/sulu/sulu/pull/6210 is merged so this bug should be fixed with the patch release of sulu/sulu.