Closed speex404 closed 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 🙂
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.
Hey @nnatter, that's great news - thank you very much :)
https://github.com/sulu/sulu/pull/6210 is merged so this bug should be fixed with the patch release of sulu/sulu.
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
Add a new article in the Sulu backend:
Reindex the articles:
bin/adminconsole sulu:article:reindex --drop --no-interaction
bin/websiteconsole sulu:article:reindex --drop --no-interaction
Open a page in the frontend where the
{{ routePath }}
is used.Furthermore
The PHPCR node properties differ between the
live
and thedefault
version. Among other things there is noroutePath
property in the subset of the live session.To reproduce this:
bin/console doctrine:phpcr:node:dump --identifiers "your articles UUID" --props --session default
bin/console doctrine:phpcr:node:dump --identifiers "your articles UUID" --props --session live
routePath
in thelive
version.