- Issue created by @abx
I have the same type of error when using search:
Twig\Error\LoaderError: Template "modules/contrib/manage_display/templates/field--node--uid.html.twig" is not defined. in Twig\Loader\ChainLoader->getCacheKey() (line 110 of core/themes/olivero/templates/content/comment.html.twig).- First commit to issue fork.
- ๐ฎ๐ณIndia dineshkumarbollu
Hi
I Tested the module in both D9 and D10 for comment types and content type, When click on "Manage layout" it works fine in my local.
I am attaching screenshots of it.'Thanks
- ๐ซ๐ทFrance PhilY ๐ช๐บ๐ซ๐ท Paris, France
I face same kind of error using Drupal 10.1.2 with stock node full display mode (no Layout Builder), either with Olivero or a Radix child theme.
Disabling or removing the comment field from my content type display mode removes the error.A temporary fix was to duplicate the
field.html.twig
template tofield--node--uid.html.twig
in my custom theme (or to write your own twig as long as the file exists).Then another similar error yells about missing
field--node--created.html.twig
file.
Again, duplicating thefield.html.twig
template tofield--node--created.html.twig
fixes it.I've also tried uninstalling manage_display module by curiosity: it removed the 'Written by' (uid) and 'Written on' (created) fields from content type form displays and view modes!!!
- ๐บ๐ธUnited States cedewey Denver, CO
Thanks PhilY for sharing that temporary workaround. I've updated the issue summary with that info. I am also experiencing this issue with trying to display comments on my site.
- ๐บ๐ธUnited States timb
I ran into this error when trying to view a feeds node. Fix was to copy and rename template files into custom theme:
field--node--created.html.twig
field--node--uuid.html.twig - First commit to issue fork.
- last update
12 months ago 2 pass - Status changed to Needs review
12 months ago 7:34am 16 January 2024 - ๐บ๐ฆUkraine AstonVictor
Created a new MR to fix it.
It comes from the
manage_display_theme()
function. It adds new themes but doesn't provide templates in the/templates
folder.I copied all required templates from the node/templates folder to the module folder.
Please, review if it works.
- ๐ฌ๐งUnited Kingdom adamps
Thanks.
I don't really understand why there is a problem. The new themes have a base hook, so why isn't the base template used?
Unfortunately I don't think the patch works. When field--node--uid.html.twig is missing, the field display will fallback to field.html from the theme. After this patch it uses a copy of field.html from Core. So for example it can be missing some classes.
- Status changed to Needs work
12 months ago 7:58am 22 January 2024 - last update
12 months ago 2 pass - Status changed to Needs review
12 months ago 11:10am 24 January 2024 - ๐บ๐ฆUkraine AstonVictor
I updated the MR by adding
'path'
property to themes. - ๐ฌ๐งUnited Kingdom adamps
Thanks, that's an interesting idea. Did you test that it works in the case from #12, when field--node--uid.html.twig is missing?
Before the patch it would use field.html from the theme.
Perhaps with this patch it would use field--node--uid.html from the node module?? This could cause a problem on upgrading existing sites.
- ๐บ๐ฆUkraine AstonVictor
I checked Drupal 8, 9 & 10 versions and all of them contain
field--node--uid.html
template in the node module.I didn't find in core examples where the theme has a 'base hook' and doesn't have a template for the theme.
e.g.
-block__system_menu_block
theme has'base hook' => 'block',
and hasblock--system-menu-block.html.twig
template in the same module;
-field__comment
theme has'base hook' => 'field',
and hasfield--comment.html.twig
template in the same module.I guess 'base hook' means which preprocess functions should be included for the theme.
- Status changed to Needs work
11 months ago 4:24pm 10 February 2024 - ๐ฌ๐งUnited Kingdom adamps
Thanks I agree with everything in #16. My question is about this case.
The site uses a custom theme which provides templates for field, field--node--uid but not field--uid.
The site has an entity type called zzz with a field called uid that is not ever inline. What template is used?
- My guess is before the patch is was
field
from the theme. - What about after? Does is still {% include "field.html.twig" %} from the custom theme??
- My guess is before the patch is was
- Status changed to Needs review
11 months ago 2:00pm 14 February 2024 - ๐บ๐ฆUkraine AstonVictor
> Compatibility with Layout Builder
I don't think it is related to the layout builder module. I have
Twig\Error\LoaderError: Template "modules/contrib/manage_display/templates/field--node--uid.html.twig" is not defined.
error with disabled layout builder.my steps on the clean Drupal 10.1.5 site with Olivero theme:
1. create a new article node
2. add a new commentresult: I see the fatal error. the error comes from
$variables['author_name'] = $renderer->render($variables['author_name']);
line oftemplate_preprocess_submitted()
function.> The site uses a custom theme which provides templates for field, field--node--uid but not field--uid.
It should be configured via theme suggestions. - Status changed to Postponed: needs info
11 months ago 4:26pm 14 February 2024 - ๐ฌ๐งUnited Kingdom adamps
> I don't think it is related to the layout builder module.
Sure then please update the IS๐. I don't see the problem on any of my sites without layout builder so please provide a sequence of steps to reproduce that should work for me too.> It should be configured via theme suggestions.
Please assume a standard install of Drupal Core and this module: the only hook_theme_suggestions() implementations are from that.The question in #12/#15/#17 is essential for me as part of the review process. I don't know what else I can do to explain it๐. We need to understand if this patch would change the behaviour of this module, altering which templates are used for existing sites.
- Status changed to Needs review
11 months ago 11:49am 15 February 2024 - ๐บ๐ฆUkraine AstonVictor
> The question in #12/#15/#17 is essential for me as part of the review process. I
as for me, It looks the same because fields use the same theme.
I enabled twig debug and attached a screenshot (suggestions.png ) to show you that they use templates from the node module. - Status changed to RTBC
9 months ago 3:10pm 16 April 2024 - ๐ฌ๐งUnited Kingdom adamps
Yes it's good, very clever thanks.
Currently there are no more NR, and 2 are RTBC ready to merge (including this one). Please let me know when you are ready for me to create a new release.
-
AstonVictor โ
committed edfb81af on 3.x
#3371841 - Add templates
-
AstonVictor โ
committed edfb81af on 3.x
- Status changed to Fixed
9 months ago 12:23pm 17 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.