Single Directory Components templates are not auto reloaded after change

Created on 24 June 2024, 6 months ago

Problem/Motivation

When twig.config:auto_reload is true, the component's templates are not refreshed, they only refreshed after the change to the YML file.
This is also weird because the parsed YML file is cached separately anyway.

This issue lies in \Drupal\Core\Template\Loader\ComponentLoader::isFresh. It is checking the YML file, and if YML is not updated, it will never check the template itself.

Steps to reproduce

Set twig.config:auto_reload to true
Create component
Render component
Change the component's template
The component still renders the old contents while the usual templates are refreshed.

Proposed resolution

Always check if the template file is fresh. Not sure the YML file needs to be checked at all since its contents will be cached anyway.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

Release notes snippet

-

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
single-directory componentsΒ  β†’

Last updated 3 days ago

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024