Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] - unknown option row_attr #33682

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

Closed
mcsky opened this issue Sep 24, 2019 · 5 comments
Closed

[Form] - unknown option row_attr #33682

mcsky opened this issue Sep 24, 2019 · 5 comments

Comments

@mcsky
Copy link

mcsky commented Sep 24, 2019

Symfony version(s) affected: 4.3.4

Description
It seems that form field has the new option row_attr. But I’m trying to use it (my version is 4.3.4 for all Sf dependencies) but I get the form error unknown option error.

The option "row_attr" does not exist. Defined options are: ........

How to reproduce

Use the row_attr option

Possible Solution

I fixed it by modifying the FormType class and add the option like done for label_attr for example.

Do I'm missing something?
I can submit a PR, if this is a real issue

@stof
Copy link
Member

stof commented Sep 24, 2019

it looks like the PR trying to add this option was incomplete.

@javiereguiluz
Copy link
Member

I guess it's related to #33552, which is being fixed in #33573. Could you please check if the changes done in #33573 would solve the issue for you? Thanks!

@stof
Copy link
Member

stof commented Sep 24, 2019

@javiereguiluz the issue is not only form themes. form_div_layout.html.twig has support for this row_attr view variable. but FormType does not support the option (and so does not set the variable either).
#30320 has not added the option.

@javiereguiluz javiereguiluz changed the title [FORM] - unknown option row_attr [Form] - unknown option row_attr Sep 24, 2019
@mcsky
Copy link
Author

mcsky commented Sep 24, 2019

It seems that the option row_attr isn't add in available options of FormType class like @stof mentionned.

I'm currently working on a PR, some tests are failing for the moment.

@mcsky
Copy link
Author

mcsky commented Sep 24, 2019

@javiereguiluz or @stof PR opened ready for review 👍

xabbuh added a commit that referenced this issue Sep 25, 2019
This PR was merged into the 4.3 branch.

Discussion
----------

Add missing row_attr option to FormType

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix: #33682 - related issue #33573
| License       | MIT

The #33573 modified Symfony's form themes. But the [FormType](https://github.com/symfony/form/blob/master/Extension/Core/Type/FormType.php) don't allow the option `row_attr` so the OptionResolver throw an exception that the option is unknown.

This PR basically add the option and give it to the form view (like `label_attr` do)

Commits
-------

d711ea2 Add missing row_attr option to FormType
@xabbuh xabbuh closed this as completed Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants