From 288c8a8b272af85cf1b62d82b5633e16bbf44d15 Mon Sep 17 00:00:00 2001 From: torleif Date: Tue, 12 Jan 2016 11:38:03 +1300 Subject: [PATCH 1/2] FIX OptionsetField returns valid HTML #4901 --- forms/OptionsetField.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/forms/OptionsetField.php b/forms/OptionsetField.php index 42c1bab84..e23cbb672 100644 --- a/forms/OptionsetField.php +++ b/forms/OptionsetField.php @@ -102,4 +102,14 @@ class OptionsetField extends DropdownField { public function ExtraOptions() { return new ArrayList(); } + + public function getAttributes() { + $attributes = parent::getAttributes(); + unset($attributes['name']); + unset($attributes['required']); + unset($attributes['role']); + unset($attributes['aria-required']); + + return $attributes; + } } From a7110bef703db749ebfea6da1e9d10c310e0624a Mon Sep 17 00:00:00 2001 From: Torleif West Date: Tue, 12 Jan 2016 14:52:36 +1300 Subject: [PATCH 2/2] FIX OptionsetField uses aria-required --- forms/OptionsetField.php | 1 - 1 file changed, 1 deletion(-) diff --git a/forms/OptionsetField.php b/forms/OptionsetField.php index e23cbb672..eb7fea930 100644 --- a/forms/OptionsetField.php +++ b/forms/OptionsetField.php @@ -108,7 +108,6 @@ class OptionsetField extends DropdownField { unset($attributes['name']); unset($attributes['required']); unset($attributes['role']); - unset($attributes['aria-required']); return $attributes; }