Deprecate help option in FieldDescription#6215
Deprecate help option in FieldDescription#6215jordisala1991 merged 1 commit intosonata-project:3.xfrom
Conversation
| // NEXT_MAJOR: Remove this block. | ||
| if (isset($options['help'])) { | ||
| $fieldDescription->setHelp($options['help']); | ||
| unset($options['help']); |
There was a problem hiding this comment.
Symfony help option didn't work because the option was removed.
There was a problem hiding this comment.
Truly says was:
Symfony help option didn't work because the description field option was removed.
There was a problem hiding this comment.
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.
After you fix help dosnt unset from options
There was a problem hiding this comment.
Dont miss difference between options and field description options
There was a problem hiding this comment.
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.
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.
| {% 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.
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.