Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Fix namespaced paths in Contao DataCollector #1379

Merged
merged 2 commits into from
Feb 20, 2018

Conversation

sheeep
Copy link
Member

@sheeep sheeep commented Feb 19, 2018

The Contao DataCollector used an outdated method for referencing templates which
seen to have been remove recently. Update to the modern @-prefixed way of referencing
templates.

Fixes the following error (occures when opening the debugger, or even just show the debug toolbar).

The profiler template "ContaoCore:Collector:contao.html.twig" for data collector "contao" does not exist.

UnexpectedValueException
in vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php (line 108)

In the past, Symfony used a different syntax to refer to templates. This format, which uses colons (:) to separate each template path section, is less consistent and has worse performance than the Twig syntax. (https://symfony.com/doc/3.4/templating/namespaced_paths.html)

[...] but you must prefix the @ character when using it in templates (that's how Twig can differentiate namespaces from regular paths). (https://symfony.com/doc/current/templating/namespaced_paths.html)

There is one open question (thus tagged as RFC). It does seem to work in the managed edition. Any idea why?

The Contao DataCollector used an outdated method for referencing templates which
seen to have been remove recently. Update to the modern @-prefixed way of referencing
templates.

> In the past, Symfony used a different syntax to refer to templates. This format, which uses colons (:) to separate each template path section, is less consistent and has worse performance than the Twig syntax. (https://symfony.com/doc/3.4/templating/namespaced_paths.html)

> [...] but you must prefix the @ character when using it in templates (that's how Twig can differentiate namespaces from regular paths). (https://symfony.com/doc/current/templating/namespaced_paths.html)
@leofeyer leofeyer added the bug label Feb 19, 2018
@leofeyer leofeyer added this to the 4.4.15 milestone Feb 19, 2018
leofeyer pushed a commit that referenced this pull request Feb 19, 2018
Description
-----------

Details available in [this PR](#1379).

> Update to the modern @-prefixed way of referencing templates.

Commits
-------

2e79392 Use the modern @-notation when referencing twig templates
@leofeyer leofeyer merged commit 94c7ea7 into contao:4.4 Feb 20, 2018
@leofeyer
Copy link
Member

Thank you @sheeep.

@leofeyer leofeyer modified the milestones: 4.4.15, 4.4 May 14, 2019
leofeyer added a commit that referenced this pull request Jun 9, 2020
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes #1379
| Docs PR or issue | -

Commits
-------

5f203303 Hide the crawler in maintenance mode
aa7e9a75 Show a hint in the back end why crawler is unavailable
ecea5974 Resolve the conflict and change the error message to an info message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants