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

Anlegen eines Moduls vom Typ Zwei-Faktor-Authentifizierung erzeugt Fehler #5859

Closed
Kabathus opened this issue Mar 9, 2023 · 2 comments · Fixed by #5870
Closed

Anlegen eines Moduls vom Typ Zwei-Faktor-Authentifizierung erzeugt Fehler #5859

Kabathus opened this issue Mar 9, 2023 · 2 comments · Fixed by #5870
Labels

Comments

@Kabathus
Copy link

Kabathus commented Mar 9, 2023

Affected version(s)

5.1

Description

Beim anlegen eines neuen Moduls, kommt eine Fehlermeldung sobald im Dropdown bei "Modultyp" der Punkt "Zwei-Faktor-Authentifizierung" ausgewählt wird.

Fehlermeldung im Browser:
Internal Server Error
Was ist das Problem?
Tried to list template options for the modern fragment type "frontend_module/two_factor" but could not find any template. In case you wanted to use the legacy type "mod_two_factor", define it explicitly in the "template" property of your controller's service tag/attribute.

Im Log:
request.CRITICAL: Uncaught PHP Exception LogicException: "Tried to list template options for the modern fragment type "frontend_module/two_factor" but could not find any template. In case you wanted to use the legacy type "mod_two_factor", define it explicitly in the "template" property of your controller's service tag/attribute." at /var/www/clients/client1/web193/web/vendor/contao/core-bundle/src/EventListener/DataContainer/TemplateOptionsListener.php line 85 {"exception":"[object] (LogicException(code: 0): Tried to list template options for the modern fragment type \"frontend_module/two_factor\" but could not find any template. In case you wanted to use the legacy type \"mod_two_factor\", define it explicitly in the \"template\" property of your controller's service tag/attribute. at /var/www/clients/client1/web193/web/vendor/contao/core-bundle/src/EventListener/DataContainer/TemplateOptionsListener.php:85)"} []

@leofeyer
Copy link
Member

leofeyer commented Mar 9, 2023

@m-vo /cc

@m-vo
Copy link
Member

m-vo commented Mar 11, 2023

See #5870

@m-vo m-vo closed this as completed Mar 11, 2023
@m-vo m-vo linked a pull request Mar 11, 2023 that will close this issue
leofeyer pushed a commit that referenced this issue Mar 13, 2023
)

Description
-----------

Fixes #5859

The two factor controller is the only fragment controller that does not have a modern template, yet. 🙈 Unfortunately, we cannot really introduce one now without breaking cases where people adjusted the legacy template (this won't work anymore then). The downside is, that we will only be able to move away from this in Contao 6. But as modules should be phased out anyways in the distant future, this might not be such a big problem…

This PR fixes the issue by manually defining the legacy template (`mod_two_factor`) in the controller, effectively overwriting the new default (`frontend_module/two_factor`).

@Kabathus Can you check if this fixes your issue?

Commits
-------

dcb3b55 explicitly set the legacy template
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants