プロジェクト

全般

プロフィール

Vote #74532

完了

HTML 5 validation failures

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
70
issue_org_id:
15191
author_id:
85369
assigned_to_id:
1
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Asserted fixes for HTML 5. Part 1.


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="">&nbsp;</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 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0