Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a mechanism for subscribers to PageHeaderDisplayEvent to set the cache tags on the PageHeaderBlock. #152

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

rupertj
Copy link
Member

@rupertj rupertj commented Oct 27, 2022

This is to fix an issue on guide pages. On guide pages \Drupal\localgov_guides\EventSubscriber\PageHeaderSubscriber displays the title and summary of the guide parent page in the PageHeaderBlock, but has no way to update the cache tags on the block to allow the block to update when the parent page is changed.

This PR adds a mechanism for listeners to PageHeaderDisplayEvent to override the block's cache tags if they include data from other entities.

@siliconmeadow
Copy link
Member

LGTM :-)

@finnlewis
Copy link
Member

Thanks for this @rupertj
Hopefully @stephen-cox @ekes @andybroomfield or @Adnan-cds will be able to review, test and approve soon. Maybe for Merge Monday next week, I'll add you to the invite for that in case you can join us.

@rupertj
Copy link
Member Author

rupertj commented Oct 28, 2022

Thanks @finnlewis. Yeah, please do invite me along on Monday. I've made a follow up PR in localgov_guides (localgovdrupal/localgov_guides#98) to fix the issue using the mechanism this PR adds, so we can go through them both together.

Copy link
Member

@ekes ekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context adding tags for more than just entity page localgovdrupal/localgov_guides@d7202f2
Can't help feeling there's some other way of doing this. But setting as is, adding cache tags makes complete sense. Test correctly fails without.

@finnlewis finnlewis merged commit c191ec8 into localgovdrupal:2.x Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants