-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add function node_types_rebuild() #133
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback
|
||
function node_types_rebuild(): void | ||
{ | ||
$tags = \Drupal::config('node_type')->getCacheTags(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is valid. There isn't a node_type
config object.
$tags[] = 'config:node_type_list'; | ||
Cache::invalidateTags($tags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is correct. We probably want the value of getListCacheTags
from the node_type
entity type definition.
src/functions/node.php
Outdated
$storage = \Drupal::service('config.storage'); | ||
assert($storage instanceof StorageCacheInterface); | ||
$storage->resetListCache(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, we could load all node_type
entities, collect their getCacheTags
and use Cache::mergeTags
to invalidate all of their individual cache tags.
0cfc3b9
to
78bb637
Compare
78bb637
to
1e3cf30
Compare
1e3cf30
to
d0d8479
Compare
d0d8479
to
fbe835e
Compare
No description provided.