[Rt-devel] [PATCH 3.7-RTIR-RELENG] XHTML nitpicks - Widgets/Form/Boolean

Jason Long jlong at messiah.edu
Tue Oct 30 12:23:29 EDT 2007


Widgets/Form/Boolean generates code like this:

  <input type="radio" name="OldestTransactionsFirst" value="1" />Yes
  <input type="radio" name="OldestTransactionsFirst" value="0" />No
  <input type="radio" name="OldestTransactionsFirst"
    value="__empty_value__" checked=&#34;checked&#34; />Use system default

XHTML validator complains:

  value of attribute "checked" cannot be "&#34;checked&#34;";
  must be one of "checked" .

The problem is we forgot to tell Mason not to escape HTML entities
in that string. See patch below.
---

 html/Widgets/Form/Boolean |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/html/Widgets/Form/Boolean b/html/Widgets/Form/Boolean
index f8e3a68..d5c698d 100644
--- a/html/Widgets/Form/Boolean
+++ b/html/Widgets/Form/Boolean
@@ -69,13 +69,13 @@ $CurrentValue => undef,
 </%ARGS>
 % unless ( $Default ) {
 <input type="hidden" name="<% $Name %>" value="0" />\
-<input type="checkbox" name="<% $Name %>" value="1" <% $CurrentValue? 'checked="checked"': '' %> />\
+<input type="checkbox" name="<% $Name %>" value="1"<% $CurrentValue? ' checked="checked"': '' |n %> />\
 % } else {
-<input type="radio" name="<% $Name %>" value="1" <% $CurrentValue? 'checked="checked"': '' %> />\
+<input type="radio" name="<% $Name %>" value="1"<% $CurrentValue? ' checked="checked"': '' |n %> />\
 <% loc('Yes') %>
-<input type="radio" name="<% $Name %>" value="0" <% defined $CurrentValue && !$CurrentValue? 'checked="checked"': '' %> />\
+<input type="radio" name="<% $Name %>" value="0"<% defined $CurrentValue && !$CurrentValue? ' checked="checked"': '' |n %> />\
 <% loc('No') %>
-<input type="radio" name="<% $Name %>" value="__empty_value__" <% !defined $CurrentValue? 'checked="checked"': '' %> />\
+<input type="radio" name="<% $Name %>" value="__empty_value__"<% !defined $CurrentValue? ' checked="checked"': '' |n %> />\
 <% $DefaultLabel %>
 % }
 </%METHOD>



More information about the Rt-devel mailing list