Skip to content

Conversation

darrenoh
Copy link
Contributor

@darrenoh darrenoh commented Dec 7, 2023

No description provided.

Copy link
Collaborator

@mglaman mglaman left a 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();
Copy link
Collaborator

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.

Comment on lines +31 to +82
$tags[] = 'config:node_type_list';
Cache::invalidateTags($tags);
Copy link
Collaborator

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.

Comment on lines 33 to 84
$storage = \Drupal::service('config.storage');
assert($storage instanceof StorageCacheInterface);
$storage->resetListCache();
Copy link
Collaborator

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.

@darrenoh darrenoh force-pushed the add-node_types_rebuild branch from 0cfc3b9 to 78bb637 Compare December 9, 2023 23:43
@darrenoh darrenoh force-pushed the add-node_types_rebuild branch from 78bb637 to 1e3cf30 Compare December 21, 2023 06:36
@darrenoh darrenoh force-pushed the add-node_types_rebuild branch from 1e3cf30 to d0d8479 Compare March 7, 2024 14:21
@darrenoh darrenoh force-pushed the add-node_types_rebuild branch from d0d8479 to fbe835e Compare March 7, 2024 17:37
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.

2 participants