Project

General

Profile

Actions

Defect #15191

closed

HTML 5 validation failures

Added by Ksenia Altbregen over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Asserted fixes for HTML 5. Part 1.


Files

html_validation_patch.diff (2.97 KB) html_validation_patch.diff Ksenia Altbregen, 2013-10-24 15:02
html_validation_patch.diff (2.87 KB) html_validation_patch.diff Revised patch Ksenia Altbregen, 2013-10-25 11:38

Related issues

Related to Redmine - Defect #5475: Non conformances with W3C xhtml transitional standardsConfirmed2010-05-08

Actions
Related to Redmine - Defect #25337: Redmine patch for Rails breaks functionality of select_tagClosed

Actions
Actions #1

Updated by Ksenia Altbregen over 10 years ago

Connected to Defect #5475.

Actions #2

Updated by Etienne Massip over 10 years ago

  • Related to Defect #5475: Non conformances with W3C xhtml transitional standards added
Actions #3

Updated by Etienne Massip over 10 years ago

  • Category set to Code cleanup/refactoring

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.

Actions #4

Updated by Ksenia Altbregen over 10 years ago

Well, I used the W3C validator.

The default empty option is really displayed as an nbsp entity, but the generated code

<option value=""></option>

is non-valid, while the
<option value="">&nbsp;</option>

is valid.

The code

check_box_tag(
  'notified_project_ids[]',
  project.id,
  @user.notified_projects_ids.include?(project.id))

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:
  :id => "notified_project_ids_#{project.id}"

Now multiple ids work correctly.

Actions #5

Updated by Ksenia Altbregen over 10 years ago

Quotes for notified_project_ids[] are single again, sorry.

Actions #6

Updated by Jean-Philippe Lang over 10 years ago

  • Tracker changed from Patch to Defect
  • Subject changed from HTML 5 Validation Venture to HTML 5 validation failures
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.4.0
  • Resolution set to Fixed

I fixed these issues more globally, see associated commits. Thanks for pointing this out.

Actions #7

Updated by Ksenia Altbregen over 10 years ago

In r12236 you've set

:id => nil

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).

Actions #8

Updated by Jean-Philippe Lang over 10 years ago

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

Actions #9

Updated by Go MAEDA about 1 year ago

  • Related to Defect #25337: Redmine patch for Rails breaks functionality of select_tag added
Actions

Also available in: Atom PDF