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
MBS-9219: Fix editing known languages field in user profile form #472
MBS-9219: Fix editing known languages field in user profile form #472
Conversation
In user profile editing form, template for adding a known language caused to systematically save an unwanted `[Multiple languages]` additional entry. This is solved by moving the template out of the <form> element.
Properly number and replace `id` and `name` template properties for added known languages in user profile editing form.
root/account/edit.tt
Outdated
[% r.select(extra_field.field('language_id'), id => 'fluency-template', class => 'language_id',) %] | ||
[% r.select(extra_field.field('fluency'), class => 'fluency') %] | ||
[% r.select(extra_field.field('language_id'), id => 'id-language-id-template', class => 'language_id', name => 'language-id-template') %] | ||
[% r.select(extra_field.field('fluency'), id => 'id-fluency-template', class => 'fluency', name => 'fluency-template') %] |
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.
Something I'm wondering is, are these id and name attributes actually needed? It seems they aren't used anywhere and are just overridden in the script below, so we can just remove them.
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.
Indeed id
s are of no use. They had to be unique, hence the override, but removal is even better. Only name
s are needed for form submission. And yes, template’s name
is worthless. Cleaned up in 547b27e
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.
The fix looks good, but I'm wondering what the purpose of those attributes is.
- Remove unused `id` and `name` attributes from template `<select>` - Set `name` attribute only to added language input
Cleaned up in 547b27e (to be squashed with previous commit) |
Fix bug MBS-9219:[Multiple languages] (Basic) is automatically added when editing/saving an editor profile and clean template code up a bit.