Hi,
We have a bug which happens in multilangual site.
We have contents with many paragraphs. Each paragraph can be un/publish independantly of the language. So, if we want to see a paragraph in english but not in french, we can unpublish the paragraph in french.
All content have been created in french in the first time, next translated in english. If we unpublished some paragraphs in content in french, the behavior is correct: Paragraphs are remove of the view mode in french and appear correctly in english for all users.
But, we have a bug if we do this in english:
If we unpublish a paragraph in a content in english, the paragraph is hidden when we are connected, like wanted. But, anonymous users see the paragraph in french on the english page.
I inspected the code and found the lines which cause the bug in the function paragraphs_type_permissions_paragraph_access (file paragraphs_type_permissions.module, line 35)
if ($operation == 'view' && !$entity->status->value) {
return AccessResult::forbidden();
}
If I'm connected, the status is 0, as expected. If I'm an anonymous user, the status is 1 and I don't know why.
So, when we are anonymous, instead of remove the paragraph of the view, the code continue and do a weird behavior.