Skip to content

Conversation

@covex-nn
Copy link

@covex-nn covex-nn commented Jan 10, 2018

If resetting feature is disabled, error The service "fos_user.mailer.default" has a dependency on a non-existent parameter "fos_user.resetting.email.from_email" is occured, when trying to send email.

A similar error occured when registration feature is disabled, but for fos_user.registration.confirmation.from_email parameter.

This PR fixes this bug

@covex-nn
Copy link
Author

@XWB please review

@XWB
Copy link
Member

XWB commented Feb 6, 2018

Why would you disable the resetting feature in the recipe? What needs to be done is adding templating to framework.yml file.

@covex-nn
Copy link
Author

covex-nn commented Feb 6, 2018

There are 3 problems with recipe: templating, mailer and doctrine-bundle

templating cannot be added to framework.yaml automaticaly (see symfony/flex#247 (comment)), twig will be used instead of templating with special fos_user.mailer.twig_swift value;

and this configuration:

fos_user:
    registration:
        confirmation:
            enabled: false
    resetting: false

will remove requirement to mailer service. See FOSUserExtension.php and Compiler/CheckForMailerPass.php

@covex-nn
Copy link
Author

covex-nn commented Feb 6, 2018

Anyway this PR fixes a bug since #2639, it is not about recipe for Flex, but it could help with creating recipe, of course =)

@covex-nn covex-nn changed the title Fix dependency error on a non-existent argument when resetting feature is disabled Fix dependency error on a non-existent argument when registration or resetting feature is disabled Feb 20, 2018
@covex-nn
Copy link
Author

covex-nn commented Feb 20, 2018

I've temporary modified tests to show errors. See travis build

@covex-nn
Copy link
Author

PR was rewritten, please review.

This PR fixes two bugs with non-existent parameter if registration or resetting feature is disabled. I've added tests, and PR is now ready again =)

'user_class' => 'fos_user.model.user.class',
),
));
$container->setParameter('fos_user.from_email', array($config['from_email']['address'] => $config['from_email']['sender_name']));
Copy link
Member

@stof stof Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't create a new fos_user.from_email. Instead, set dummy values for these emails in case the other features are not used (they won't be used anyway in such case) or set the parameters directly.

Copy link
Author

@covex-nn covex-nn Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stof fixed. i've put dummy values to mailer.xml

@XWB XWB merged commit 47a4d12 into FriendsOfSymfony:master May 22, 2018
@covex-nn covex-nn deleted the disabled-resetting branch May 22, 2018 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants