Skip to content

[Form] Deprecate TimezoneType regions option #28860

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
Oct 25, 2018
Merged

[Form] Deprecate TimezoneType regions option #28860

merged 1 commit into from
Oct 25, 2018

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Oct 14, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #28848
License MIT
Doc PR symfony/symfony-docs#...

I know i've added this option myself in 4.1, but given my recent development for #28624 i realized it's an opinionated feaure, which can/should be solved on user-side (choice_filter/choice_loader and/or group_by).

While at it, i solved a few issues with OptionsResolver that is able to deprecate options as of 4.2 also. Fixed in #28878

  • when resolved trigger the deprecation
  • allow to opt-out from triggering the deprecation
  • dont trigger deprecation for default values (only given ones)

@ro0NL
Copy link
Contributor Author

ro0NL commented Oct 16, 2018

to go after #28878

status: needs work

@fabpot
Copy link
Member

fabpot commented Oct 24, 2018

#28878 has been merged now

@ro0NL
Copy link
Contributor Author

ro0NL commented Oct 24, 2018

@yceruto a deprecated option doesnt behave correct yet, the opt-out isnt working. Each test triggers still

  15x: The option "regions" is deprecated since Symfony 4.2.
    2x in TimezoneTypeTest::testDateTimeZoneInput from Symfony\Component\Form\Tests\Extension\Core\Type

@yceruto
Copy link
Member

yceruto commented Oct 24, 2018

@yceruto
Copy link
Member

yceruto commented Oct 24, 2018

That should be fixed updating the composer constraint of the FB I guess.

@yceruto
Copy link
Member

yceruto commented Oct 24, 2018

@yceruto
Copy link
Member

yceruto commented Oct 24, 2018

Fixed in #28968

fabpot added a commit that referenced this pull request Oct 25, 2018
…(yceruto)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[OptionsResolver] Fixed explicitly ignores a depreciation

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28860 (comment)
| License       | MIT
| Doc PR        | -

When a deprecated option with default value was resolved (the first time it's called) in this case through a lazy evaluation, [the default resolution process](https://github.com/symfony/symfony/blob/8398947c9c1c1266aad0bea773d0b524e0d81643/src/Symfony/Component/OptionsResolver/OptionsResolver.php#L771-L773) takes the resolved value and here should also trigger only if the option was provided by the user or is being called from a lazy evaluation, otherwise ignore.

Commits
-------

8398947 Fixed explicitly ignores a depreciation
@ro0NL
Copy link
Contributor Author

ro0NL commented Oct 25, 2018

Status: needs review

@fabpot
Copy link
Member

fabpot commented Oct 25, 2018

Thank you @ro0NL.

@fabpot fabpot merged commit 5cb532d into symfony:master Oct 25, 2018
fabpot added a commit that referenced this pull request Oct 25, 2018
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Form] Deprecate TimezoneType regions option

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #28848
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

I know i've added this option myself in 4.1, but given my recent development for #28624 i realized it's an opinionated feaure, which can/should be solved on user-side (`choice_filter/choice_loader` and/or `group_by`).

- blocks translations as we dont have them (see #28831)
- blocks possibility of switching to Intl zones which doesnt really have this filter feature (see #28836)

~While at it, i solved a few issues with `OptionsResolver` that is able to deprecate options as of 4.2 also.~ Fixed in #28878

- when resolved trigger the deprecation
- allow to opt-out from triggering the deprecation
- dont trigger deprecation for default values (only given ones)

Commits
-------

5cb532d [Form] Deprecate TimezoneType regions option
@ro0NL ro0NL deleted the tz-regions branch October 25, 2018 13:25
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Oct 26, 2018
This PR was merged into the master branch.

Discussion
----------

[Form] Deprecated timezone regions option

see symfony/symfony#28860

Commits
-------

edf7f5d [Form] Deprecated timezone regions option
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
This was referenced Nov 3, 2018
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.

6 participants