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

[Notifier] Add correct tags for NullTransportFactory #35826

Merged
merged 1 commit into from Feb 23, 2020

Conversation

jschaedl
Copy link
Contributor

Q A
Branch? 5.0
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

I tried to disable the delivery of notifications in dev environment with the following configuration:

framework:
    notifier:
        chatter_transports:
            slack: 'null://null'
        texter_transports:
            twilio: 'null://null'
        channel_policy:
            urgent: ['chat/slack', 'sms/twilio']
            high: ['email']
            medium: ['email']
            low: ['email']

While sending the notification like this:

$notification = (new Notification())
            ->subject('Test subject')
            ->importance(Notification::IMPORTANCE_URGENT)
            ->content('Test content')
;

$this->notifier->send($notification);

I got an UnsupportedSchemeException: The "null" scheme is not supported.

After some digging I figured out that this Exception occurred because the NullTransportFactory was not tagged with the chatter.transport_factory and texter.transport_factory tags. Which is the reason the NullTransportFactory was not injected in the Transport class and so the NullTransport couldn't be used.

This PR should fix this Bug.

@nicolas-grekas
Copy link
Member

Thank you @jschaedl.

@nicolas-grekas nicolas-grekas merged commit 03f525a into symfony:5.0 Feb 23, 2020
@fabpot fabpot mentioned this pull request Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants