Vote #74532
完了HTML 5 validation failures
0%
journals
Connected to Defect #5475.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Please describe your patch, I don't get the default empty option displayed as an nbsp entity part and @"notified_project_ids[]"@ should remain @'notified_project_ids[]'@ with single quotes, this is not JavaScript.
--------------------------------------------------------------------------------
Well, I used the W3C validator.
The default empty option is really displayed as an nbsp entity, but the generated code
<pre><option value=""></option></pre>
is non-valid, while the
<pre><option value=""> </option></pre>
is valid.
The code
<pre>check_box_tag(
'notified_project_ids[]',
project.id,
@user.notified_projects_ids.include?(project.id))</pre>
did not work correctly; it did not convert notified_project_ids[] for each project to notified_project_ids_#{project.id}. The ids for all projects were identical.
I added the id parameter manually:
<pre> :id => "notified_project_ids_#{project.id}"</pre>
Now multiple ids work correctly.
--------------------------------------------------------------------------------
Quotes for notified_project_ids[] are single again, sorry.
--------------------------------------------------------------------------------
I fixed these issues more globally, see associated commits. Thanks for pointing this out.
--------------------------------------------------------------------------------
In r12236 you've set <pre>:id => nil</pre>
Is this really acceptable? The elements now have no ids at all.
I've also noticed that these elements have identical names.
Both problems could be fixed by explicit transmission of :id and :name values.
P.S. There are several places with this problem (e.g. user[group_ids][] and membership[role_ids][] in users/views).
--------------------------------------------------------------------------------
Ksenia Altbregen wrote:
> In r12236 you've set [...]
> Is this really acceptable? The elements now have no ids at all.
AFAIK, ids are not required. And they are not needed in this case, so I've set them to nil.
> I've also noticed that these elements have identical names.
Yes, they have to have the same name to get the values as a single array parameter. Please, have a look at:
http://guides.rubyonrails.org/action_controller_overview.html#hash-and-array-parameters
--------------------------------------------------------------------------------
related_issues
relates,Confirmed,5475,Non conformances with W3C xhtml transitional standards
Admin Redmine さんが3年以上前に更新
- カテゴリ を Code cleanup/refactoring_30 にセット
- 対象バージョン を 2.4.0_70 にセット