Skip to content

Fixed parsing deprecated definitions without message key #40541

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

Merged
merged 1 commit into from
Mar 23, 2021
Merged

Fixed parsing deprecated definitions without message key #40541

merged 1 commit into from
Mar 23, 2021

Conversation

adamwojs
Copy link
Contributor

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

Steps to reproduce

  1. Create service/alias definition and mark it as deprecated without specifying message key as shown in https://symfony.com/doc/5.2/service_container/alias_private.html#deprecating-service-aliases. For example:
services:
    service_without_deprecation_message:
        class: Foo
        deprecated:
            package: vendor/package
            version: 1.1

    alias_without_deprecation_message:
        alias: foobar
        deprecated:
            package: vendor/package
            version: 1.1
  1. Clear cache by running php bin/console cache:clear

Actual behaviour

Symfony\Component\Config\Exception\LoaderLoadException exception is thrown with the following message: Warning: Undefined array key "message" (...)

See https://gist.github.com/adamwojs/5bac85d4326d8fbe6f52a357fa6e57e6 for full stactrace.

Excepted behaviour

Given definitions are loaded correctly. Default service/alias deprecation message is used as shown in linked documentation page.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@adamwojs adamwojs changed the title Fixed parsing deprecated definitions without message key [DependencyInjection] Fixed parsing deprecated definitions without message key Mar 22, 2021
@carsonbot
Copy link

Hey!

I had a quick look at this PR, I think it is alright.

I think @mtarld has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@carsonbot carsonbot changed the title [DependencyInjection] Fixed parsing deprecated definitions without message key Fixed parsing deprecated definitions without message key Mar 23, 2021
@nicolas-grekas
Copy link
Member

Thank you @adamwojs.

@nicolas-grekas nicolas-grekas merged commit e494b38 into symfony:5.2 Mar 23, 2021
@adamwojs adamwojs deleted the undefined_index_message branch March 23, 2021 13:25
@fabpot fabpot mentioned this pull request Mar 29, 2021
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.

3 participants