Closed luca-rath closed 1 year ago
The strange thing is that the logic here:
And here:
And here:
Are pages and snippet behaving correctly and don't have the same issue with any types filters?
Hello, any news about this? I tested the fix directly in the vendors and it works well. Thank you in advance for the update!
I'm merging this also when I think there some changes maybe also in the core then required.
Hi team,
Any chance to fix this in sulu:2.4 ? Thank you for your help.
What's in this PR?
This PR fixes the problem described in https://github.com/tommysonsylverstone/sulu-elasticsearch-user-bug
Why?
The
ArticleDataProvider::getTypes()
method is used to callConfigurationBuilder::enableTypes()
(see https://github.com/sulu/SuluArticleBundle/blob/2.x/Content/ArticleDataProvider.php#L499). This method only returns types, if there is aTokenStorage
with a user, to use the user's locale to return the title of the templates in the correct locale. This works fine, because in most cases, this just returns the types in the admin context and not in the website context. But as soon as there is a website user, this method also returns types, and theArticleDataProvider
doesn't expect that, because those types are used in theContentType::getDefaultParams()
. Because that logic is in sulu itself, we should not touch it and instead work around that here in the article bundle.