-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Deprecate help option in FieldDescription #6215
Deprecate help option in FieldDescription #6215
Conversation
if (isset($options['help'])) { | ||
$fieldDescription->setHelp($options['help']); | ||
unset($options['help']); |
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.
Symfony help
option didn't work because the option was removed.
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.
description 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.
What do you mean?
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.
Truly says was:
Symfony help option didn't work because the description field option was removed.
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.
hmm not exactly true, here at FormMapper
it checked if the help
form option was set, given:
->add('field', null, ['help' => 'message'])
the $options
variable contains among other things ['help' => 'message']
, then it executed:
$fieldDescription->setHelp($options['help']);
so this help message is set as field description option and then:
unset($options['help']);
which removes the form option, so it's never in the $options
array that is passed to the form builder.
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.
After you fix help
dosnt unset from options
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.
Dont miss difference between options and field description options
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.
You says:
Symfony help option didn't work because the option was removed.
And
Use Symfony Form "help" option instead.
This is mismatch statements
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.
Ok... I added that comment at the time I made the PR to explain the reason behind that change, so what I meant is... before making this change, Symfony Form "help" option didn't work as you expected (using ->add('field', null, ['help' => 'message'])
) because that option was never passed as form option. After this change, you could use Symfony Form help
option and it will work as expected.
@@ -35,7 +35,7 @@ file that was distributed with this source code. | |||
|
|||
{% block form_help %} | |||
{% apply spaceless %} | |||
<span class="help-block sonata-ba-field-widget-help">{{ parent() }}</span> | |||
<span class="help-block sonata-ba-field-widget-help sonata-ba-field-help">{{ parent() }}</span> |
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 added this class because is the one used in the deprecated help
.
Could you please rebase your PR and fix merge conflicts? |
12da595
to
bea33c9
Compare
Could you please rebase your PR and fix merge conflicts? |
bea33c9
to
392ce65
Compare
Could you please rebase your PR and fix merge conflicts? |
392ce65
to
970e196
Compare
Thank you @franmomu |
Subject
Ref: #6206 (comment)
I haven't seen any use case rather than showing help messages in form fields.
I am targeting this branch, because these changes are BC.
Closes #6207.
Changelog
I have to check if it works fine with nested fields.