Symfony version: 4.0.2
Symfony FOSUserBundle versions: "friendsofsymfony/user-bundle": "dev-master"
friendsofsymfony/user-bundle dev-master 5d1c3ff Symfony FOSUserBundle
Description of the problem including expected versus actual behavior:
composer require friendsofsymfony/user-bundle:dev-masterProblem location:
<argument type="service" id="templating" /> in the file: /vendor/friendsofsymfony/user-bundle/Resources/config/mailer.xml<argument type="service" id="templating.engine.twig" /><argument type="service" id="templating.engine.php" /><argument type="service" id="templating.engine.delegating" />However, by choosing one of those services, the exception is not removed!
Thanks for your help!
After some search, the next services:
<argument type="service" id="templating.engine.twig" /><argument type="service" id="templating.engine.php" /><argument type="service" id="templating.engine.delegating" />seems to haven't a public visibility to be accessed to.
I got the error away by adding the following lines to my config/packages/framework.yaml file without further changes to other files.
templating:
engines:
twig
I then ran my developing site, went to /register, registered a new user and activated it manually afterwards (as the email cannot be sent from my development area) without facing any issues.
Templating service should be available in Symfony. If not, please install symfony/templating.
framework:
templating:
engines: ['twig', 'php']
This is deprecated starting in Symfony 4.3:
The "framework.templating" configuration is deprecated since Symfony 4.3. Configure the "twig" section provided by the Twig Bundle instead.
As @tacman says, "framework.templating" is deprecated since Symfony 4.3.
The templating (Symfony\Bundle\FrameworkBundle\Templating\EngineInterface) is used by the class "FOS\UserBundle\Mailer\Mailer".
Until the mailer of FOSUserBundle is rewritten with the new mailer component added in Symfony 4.3, it is possible to configure FOSUserBundle to use the class "FOS\UserBundle\Mailer\TwigSwiftMailer" to work around this issue.
To do this, add the 2 lines:
聽聽聽聽 service:
聽聽聽聽聽聽聽聽 mailer: fos_user.mailer.twig_swift
at the end of the file "config/packages/fos_user.yaml"
you will be able to delete the lines:
framework:
聽聽聽聽 templating:
聽聽聽聽聽聽聽聽 engines: ['twig', 'php']
in the file "config/packages/framework.yaml"
Most helpful comment
I got the error away by adding the following lines to my
config/packages/framework.yamlfile without further changes to other files.I then ran my developing site, went to /register, registered a new user and activated it manually afterwards (as the email cannot be sent from my development area) without facing any issues.