The render cache needs to be invalidated when allowed languages change for a user.
If not, the operations on /admin/content and /admin/structure/custom_blocks are not updated.

For example, when activating EN for a particular user, the user doesn't see the edit button for EN content on /admin/content until cache is rebuild.

CommentFileSizeAuthor
#8 2965661-8.patch698 bytesheddn
#2 allowed_languages-2965661-2.patch525 bytesjurgenr

Comments

JurgenR created an issue. See original summary.

jurgenr’s picture

StatusFileSize
new525 bytes

I've added a patch that rebuilds the render cache on user save.

jurgenr’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: allowed_languages-2965661-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

postovan dumitru’s picture

Hi @jurgenr,

I wanted to ask you, why invalidate all the renderer cache? As far as I know, we could provide a custom cache tag, and then invalidate it in the user form submit function, how does that sound?

weseze’s picture

@postovan: How would you add this custom cache tag in all places were it is relevant?

I think the form submit function would need to more selectively clear known cache tags so that for example the view at /admin/content/ gets invalidated.

postovan dumitru’s picture

@weseze

Sorry for my extremely late response. As far as I remember, there is a hook altering the operations in the module. Defining a clearing functionality and adding this cache tag to entity operations might not be that hard. Then again I might be completely wrong and I'm open for any alternative suggestions.

Otherwise yeah, clearing just the render cache instead of all cache is the solution here, but I would rather avoid clearing render cache for elements unrelated to user data.

heddn’s picture

Status: Needs work » Needs review
StatusFileSize
new698 bytes

I think the approach here in this patch is the better method. No interdiff as this is a different approach.

nterbogt’s picture

Status: Needs review » Needs work

While I agree with the approach. This patch (8) did not actually fix the issue, and I can still reproduce it with the patch applied.
The Access response of allowed (cached per user or not) doesn't actually bubble up to the page level cache; so it's not reset.

nterbogt’s picture

A more extensive version of this change has been rolled into the 2.x-dev branch; which needs some user testing.