-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.8][Form] Deprecate alias tag option #15926
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
Conversation
$alias = isset($tag[0]['alias']) | ||
? $tag[0]['alias'] | ||
: $serviceId; | ||
$extendedType = $serviceId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need a deprecation to be triggered when the service id is used, because such case makes no sense actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it doesn't mean anything, but it's the default at the moment. Do you think we should require setting the extended_type
attribute and trigger an exception if it (or alias) is not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wouterj yes if neither the alias or extended_type is set, it should trigger a deprecation as well. in 3.0 it should then throw an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move this to the else
block which makes it more clear what code can be removed later
d048496
to
3a62981
Compare
PR updated |
Status: Needs Work |
3a62981
to
f15bfdd
Compare
Unless I missed something, I've now finished this PR:
|
f15bfdd
to
9b76e71
Compare
Status: Needs Review |
Build failures are not related to this PR btw |
@@ -235,6 +235,23 @@ Form | |||
match the type returned by `getExtendedType` is now forbidden. Fix your | |||
implementation to define the right type. | |||
|
|||
* The alias option of the `form.type_extension` tag is deprecated in favor of | |||
the `extended_type` option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also use extended_type
/extended-type
esp. since the following is code is xml which will cause confusion.
Fixed, thanks @Tobion |
$alias = isset($tag[0]['alias']) | ||
? $tag[0]['alias'] | ||
: $serviceId; | ||
$extendedType = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is useless, but it doesn't hurt that much and reduces the changes to be done in 3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in 3.0 we will throw an exception, there is no default null
Thank you @wouterj. |
…ibutes (WouterJ) This PR was merged into the 3.0-dev branch. Discussion ---------- [WIP][3.0][Form] Removed usage of deprecated form tag attributes | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - WIP because it needs some adjustments after #15926 is merged Commits ------- 215fdbe Removed alias attribute usages
FQCN should be used since 2.8 instead, so a deprecation error should be triggered when the
alias
setting is used.Furthermore, the name of the option doesn't make much sense for form types (as it's the alias of the field it applies to), so I renamed it to
extended_type
. I'm open to any other suggestions.