Problem/Motivation

When Drupal's Twig debugging feature is turned on, the Components module should output debugging comments too.

The debugging comments should list:

  • The namespace-based reference to the template, e.g. @namespace/path/template.twig
  • The file path to the template, relative to the Drupal root.
<!-- THEME DEBUG -->
<!-- TWIG TEMPLATE: '@namespace/path/template.twig' -->
<!-- BEGIN OUTPUT from 'themes/custom/example/namespace/path/template.twig' -->
[ template contents ]
<!-- END OUTPUT from 'themes/custom/example/namespace/path/template.twig' -->

Issue fork components-3216184

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

JohnAlbin created an issue. See original summary.

DieterHolvoet made their first commit to this issue’s fork.

dieterholvoet’s picture

Status: Active » Needs review

I implemented this feature, but with a slightly different comment structure in order to make the difference between core and components debug comments clearer:

<!-- THEME DEBUG -->
<!-- COMPONENT: @namespace/path/template.twig -->
<!-- BEGIN OUTPUT from 'themes/custom/example/namespace/path/template.twig' -->
[ template contents ]
<!-- END OUTPUT from 'themes/custom/example/namespace/path/template.twig' -->
johnalbin’s picture

I implemented this feature, but with a slightly different comment structure in order to make the difference between core and components debug comments clearer

That will reduce the number of support requests in Drupal core's queue. Good thinking.

johnalbin’s picture

Status: Needs review » Needs work

Needs some tweaking but the MR is fantastic! I wouldn't have known how to implement this feature otherwise.

johnalbin’s picture

Status: Needs work » Reviewed & tested by the community

johnalbin’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.