From f62efb6270b7971bd731b469e99fa2dc3f584766 Mon Sep 17 00:00:00 2001 From: Jeff Kellem Date: Fri, 1 Dec 2023 20:22:12 -0800 Subject: [PATCH] use 'cols' as key instead of 'columns' for note_columns per coleman As suggested in this comment from @colemanw: https://github.com/civicrm/civicrm-core/pull/28388#issuecomment-1835717428 Note: This will also turn a prop of `columns` into `cols` for the key not just for a `note_columns` prop. --- Civi/Api4/Service/Spec/SpecFormatter.php | 4 +++- ext/afform/core/ang/af/fields/TextArea.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Civi/Api4/Service/Spec/SpecFormatter.php b/Civi/Api4/Service/Spec/SpecFormatter.php index b1b66b3c73..2d6c1c2020 100644 --- a/Civi/Api4/Service/Spec/SpecFormatter.php +++ b/Civi/Api4/Service/Spec/SpecFormatter.php @@ -322,7 +322,9 @@ class SpecFormatter { if ($inputType == 'TextArea') { foreach (['rows', 'cols', 'note_rows', 'note_columns'] as $prop) { if (!empty($data[$prop])) { - $inputAttrs[str_replace('note_', '', $prop)] = (int) $data[$prop]; + $key = str_replace('note_', '', $prop); + $key = str_replace('columns', 'cols', $key); // per @colemanw https://github.com/civicrm/civicrm-core/pull/28388#issuecomment-1835717428 + $inputAttrs[$key] = (int) $data[$prop]; } } } diff --git a/ext/afform/core/ang/af/fields/TextArea.html b/ext/afform/core/ang/af/fields/TextArea.html index 7abbde7379..06c1314a40 100644 --- a/ext/afform/core/ang/af/fields/TextArea.html +++ b/ext/afform/core/ang/af/fields/TextArea.html @@ -1 +1 @@ - + -- 2.25.1