Fosuserbundle: Non-existent service "fos_user.email_update_confirmation"

Created on 18 Dec 2017  路  7Comments  路  Source: FriendsOfSymfony/FOSUserBundle

Symfony FOSUserBundle versions: dev-master 8096fd6

Description of the problem including expected versus actual behavior:
Issue on vendor install

Steps to reproduce:

  1. composer install

Provide logs (if relevant):

  [RuntimeException]                                                               
  An error occurred when executing the "'cache:clear --no-warmup'" command:        

    [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]     
    The service "fos_user.email_update_listener" has a dependency on a non-exis    
    tent service "fos_user.email_update_confirmation".                             

Describe the feature:
I think issue was introduce with this commit "add email update confirmation feature "

Service fos_user.email_update_confirmation is defined in file Resources/config/email_confirmation.xml

    <service id="fos_user.email_update_confirmation" class="FOS\UserBundle\Services\EmailConfirmation\EmailUpdateConfirmation">
            <argument type="service" id="router" />
            <argument type="service" id="fos_user.util.token_generator" />
            <argument type="service" id="fos_user.mailer" />
            <argument type="service" id="fos_user.email_encryption" />
            <argument type="service" id="event_dispatcher" />
        </service>

and called in file Resources/config/doctrine.xml

        <service id="fos_user.email_update_listener" class="FOS\UserBundle\Doctrine\EmailUpdateListener" public="false">
            <argument type="service" id="fos_user.email_update_confirmation"/>
            <argument type="service" id="request_stack" />
            <tag name="doctrine.event_listener" event="preUpdate" lazy="true" />
        </service>

But if you look in file DependencyInjection/FOSUserExtension.php the file Resources/config/email_confirmation.xml is loaded just when confirmation mode is enabled

/**
     * @param array            $config
     * @param ContainerBuilder $container
     * @param XmlFileLoader    $loader
     * @param array            $fromEmail
     */
    private function loadRegistration(array $config, ContainerBuilder $container, XmlFileLoader $loader, array $fromEmail)
    {
        $loader->load('registration.xml');
        if ($config['confirmation']['enabled']) {
            $loader->load('email_confirmation.xml');
        }

Most helpful comment

All 7 comments

Got same issue updating

Same update ... same issue ...
Back to 2.0.2 ...

Got the same issue when updating :(

Same issue here...

Same.

See https://github.com/FriendsOfSymfony/FOSUserBundle/pull/2612#issuecomment-352439550

There are several bugs with this PR that I can see.

Was this page helpful?
0 / 5 - 0 ratings