- Issue created by @berdir
- Assigned to huzooka
- ππΊHungary huzooka Hungary ππΊπͺπΊ
Started working on this. So far, the view in flag_following seems to be quite dated, based on git blame.
- Merge request !70Issue #3461212: FlagViewsRelationship plugin instances should expose thir cacheability metadata β (Merged) created by huzooka
- ππΊHungary huzooka Hungary ππΊπͺπΊ
What I did so far:
- I think that @Berdir's hint about the cacheability is right. I changed FlagViewsRelationship to implement CacheableDependencyInterface, and implemented the necessary methods:
- If we're asked for a per-user relationship and the configured flag is not global, then the cache context will be
['user]
- Left the cache max age
-1
(permanent) - ...but in the cache tags, we return with the flag's cache ID (so if the flag will be changed somehow to be non-global or vice versa, then the view be recalculated).
- If we're asked for a per-user relationship and the configured flag is not global, then the cache context will be
- Installed flag_following on a vanilla Drupal (10.3.x) and copied the re-exported YAML back to the module (without the config hash parts)
- Then I cleaned up the changes in the file to help reviewing the changes... But maybe we don't want this cleanup?..
- Fixed the two PHP CS nits in the plugin class.
I don't know whether it is needed to add some test coverage for the relationship plugin, let's see a green result for first (and ideally, some community review or hits from maintainers).
- I think that @Berdir's hint about the cacheability is right. I changed FlagViewsRelationship to implement CacheableDependencyInterface, and implemented the necessary methods:
- Issue was unassigned.
- Status changed to Needs review
4 months ago 5:20pm 2 August 2024 - ππΊHungary huzooka Hungary ππΊπͺπΊ
It is green, so try to get a review for now.
-
berdir β
committed e346cb17 on 8.x-4.x authored by
huzooka β
Issue #3461212: FlagFollowerUITest failing since new access policy was...
-
berdir β
committed e346cb17 on 8.x-4.x authored by
huzooka β
- Status changed to Fixed
3 months ago 9:10am 25 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.