Fix dashboards.cache for entity Dashboard cache tags factory and arguments

Created on 25 April 2023, over 1 year ago

Problem/Motivation

Having cache issue with Dashboards under Drupal 10

Drupal 10 has the following in core.services.yml

Default cache system.

  cache.default:
    class: Drupal\Core\Cache\CacheBackendInterface
    tags:
      - { name: cache.bin }
    factory: ['@cache_factory', 'get']
    arguments: [default]

Entity cache system

  cache.entity:
    class: Drupal\Core\Cache\CacheBackendInterface
    tags:
      - { name: cache.bin }
    factory: ['@cache_factory', 'get']
    arguments: [entity]

A special cache bin that does not persist beyond the length of the request.

  cache.static:
    class: Drupal\Core\Cache\CacheBackendInterface
    tags:
      - { name: cache.bin, default_backend: cache.backend.memory }
    factory: ['@cache_factory', 'get']
    arguments: [static]

Steps to reproduce

Given a default dashboard was configured on installation of a Drupal 10 system
When navigating to the dashboard
Then it will still not load the right layouts in view mode
And same on the Layout editing mode

Proposed resolution

  • Have factory: ['@cache_factory', 'get'] format.
  • Maybe passing the right Default, Static , or Entity cache arguments.

Not sure if all things should be cached under dashboard.cache
Each entity item may have cache.entity

Remaining tasks

  • File an issue
  • Patch/MR
  • Test
  • Review

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A
📌 Task
Status

Needs review

Version

2.1

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024