From c822f240af2c6dc8bef0bad3f020d7a444d92195 Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 5 Aug 2024 15:25:34 +1200 Subject: [PATCH 1/2] FIX Update EditableFormHeading.php to output unique ID attributes to comply with accessibility standards Fixes: Multiple HeaderFields in UserForm creates WCAG Duplicate ID issue #1290 https://github.com/silverstripe/silverstripe-userforms/issues/1290 --- code/Model/EditableFormField/EditableFormHeading.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Model/EditableFormField/EditableFormHeading.php b/code/Model/EditableFormField/EditableFormHeading.php index b324d1c..f6a8b5e 100644 --- a/code/Model/EditableFormField/EditableFormHeading.php +++ b/code/Model/EditableFormField/EditableFormHeading.php @@ -70,7 +70,7 @@ class EditableFormHeading extends EditableFormField public function getFormField() { - $labelField = HeaderField::create('userforms-header', $this->Title ?: false) + $labelField = HeaderField::create('userforms-header-' . $this->ID, $this->Title ?: false) ->setHeadingLevel($this->Level); $labelField->addExtraClass('FormHeading'); $labelField->setAttribute('data-id', $this->Name); From 659e181702068ddd1158de7040fd97d0031937a0 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Tue, 13 Aug 2024 17:01:31 +1200 Subject: [PATCH 2/2] MNT Ignore phpstan error we can't fix (#1316) --- code/Model/Recipient/EmailRecipient.php | 1 + 1 file changed, 1 insertion(+) diff --git a/code/Model/Recipient/EmailRecipient.php b/code/Model/Recipient/EmailRecipient.php index 0923a07..c5b9ee7 100644 --- a/code/Model/Recipient/EmailRecipient.php +++ b/code/Model/Recipient/EmailRecipient.php @@ -575,6 +575,7 @@ class EmailRecipient extends DataObject foreach ($addresses as $address) { $trimAddress = trim($address ?? ''); if ($trimAddress && !Email::is_valid_address($trimAddress)) { + /** @phpstan-ignore translation.key (can't simplify the key without lots of duplicated code) */ $error = _t( __CLASS__.".$translation", "Invalid email address $trimAddress"