Problem/Motivation

Local tasks and actions do not build their own render arrays, so they cannot themselves inject cacheability metadata into them. The code that does build these render arrays (LocalTasksBlock and LocalActionManager) has no way of extracting this metadata from the plugins when building the render arrays for them.

Proposed resolution

Make local task and action plugins implement CacheableDependencyInterface and allow static metadata to be set through their plugin definitions.

Make LocalTasksBlock and LocalActionManager apply this metadata to the render arrays they build.

Remaining tasks

None.

User interface changes

None.

API changes

Local tasks and actions are required to implement CacheableDependencyInterface. We can make this optional (and probably) should. It requires some more work on the tests, though.

Data model changes

None.

CommentFileSizeAuthor
#2 drupal_2564011_2.patch16.15 KBxano

Comments

Xano created an issue. See original summary.

xano’s picture

Status: Active » Needs review
StatusFileSize
new16.15 KB
xano’s picture

This is already done for menu links in MenuLinktree::buildItems(), for example.

xano’s picture

LocalTaskManager builds render arrays for local tasks in several different methods. They'll all need to apply cacheability metadata.

Status: Needs review » Needs work

The last submitted patch, 2: drupal_2564011_2.patch, failed testing.

lauriii’s picture

Status: Needs work » Closed (duplicate)