Issue #3456676: Single Directory Components templates are not auto reloaded after change
3 unresolved threads
Closes #3456676
Merge request reports
Activity
added 587 commits
-
638e88b3...9cf58fe1 - 586 commits from branch
project:11.x
- 6a51f1d3 - Issue #3456676: Single Directory Components templates are not auto reloaded after change
-
638e88b3...9cf58fe1 - 586 commits from branch
added 1 commit
added 164 commits
-
91f92361...1c773fed - 163 commits from branch
project:11.x
- c6a155b3 - Merge branch '11.x' of github.com:drupal/drupal into 3456676-single-directory-components
-
91f92361...1c773fed - 163 commits from branch
122 121 catch (ComponentNotFoundException) { 123 122 throw new LoaderError('Unable to find component'); 124 123 } 125 // If any of the templates, or the component definition, are fresh. Then the 126 // component is fresh. 127 $metadata_path = $component->getPluginDefinition()[YamlDirectoryDiscovery::FILE_KEY]; Should the detection on the component definition be kept?
Edit: I would guess it had been done to avoid to have to clear the cache at each change in the YAML which can be frequent when creating new components.
Edited by Florent TorregrosaDiscussed with @pdureau, it is ok to remove refresh on YAML change.
Edited by Florent Torregrosachanged this line in version 7 of the diff
122 121 catch (ComponentNotFoundException) { 123 122 throw new LoaderError('Unable to find component'); 124 123 } 125 // If any of the templates, or the component definition, are fresh. Then the 126 // component is fresh. 127 $metadata_path = $component->getPluginDefinition()[YamlDirectoryDiscovery::FILE_KEY]; changed this line in version 7 of the diff
122 121 catch (ComponentNotFoundException) { 123 122 throw new LoaderError('Unable to find component'); 124 123 } 125 // If any of the templates, or the component definition, are fresh. Then the 126 // component is fresh. 127 $metadata_path = $component->getPluginDefinition()[YamlDirectoryDiscovery::FILE_KEY]; 128 if ($file_is_fresh($metadata_path)) { 129 return TRUE; 130 } 124 // We only support refreshing templates. 125 // If the template is fresh. Then the component is fresh. 131 126 return $file_is_fresh($component->getTemplatePath()); - Comment on lines -125 to 131
I think if I set twig to auto refresh I would expect it to behave like this:
124 // We only support refreshing templates. 125 // If the template is fresh. Then the component is fresh. 126 return $file_is_fresh($component->getTemplatePath()); 124 $metadata_path = $component->getPluginDefinition()[YamlDirectoryDiscovery::FILE_KEY]; 125 return $file_is_fresh($component->getTemplatePath()) && $file_is_fresh($metadata_path); changed this line in version 7 of the diff
added 1 commit
added 610 commits
-
8cdab7cf...1b74d431 - 608 commits from branch
project:11.x
- 973aa6c7 - Issue #3456676: Single Directory Components templates are not auto reloaded after change
- d85be52c - Issue #3456676 by grimreaper: Check for YAML file too
-
8cdab7cf...1b74d431 - 608 commits from branch
added 73 commits
-
d85be52c...148d8ddb - 71 commits from branch
project:11.x
- d7748b94 - Issue #3456676: Single Directory Components templates are not auto reloaded after change
- 1940643e - Issue #3456676 by grimreaper: Check for YAML file too
-
d85be52c...148d8ddb - 71 commits from branch
Please register or sign in to reply