From 5d2b929023deaef1b239cfba3cf8ee4246f41c43 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 1 Feb 2021 20:56:28 -0500 Subject: [PATCH] Afform - Fix filling preset values during submit At some point the `af-values` attribute got renamed `data` but the Submit api wasn't updated. --- ext/afform/core/Civi/Api4/Action/Afform/Submit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/afform/core/Civi/Api4/Action/Afform/Submit.php b/ext/afform/core/Civi/Api4/Action/Afform/Submit.php index 54a36f49d1..1f6e3e754c 100644 --- a/ext/afform/core/Civi/Api4/Action/Afform/Submit.php +++ b/ext/afform/core/Civi/Api4/Action/Afform/Submit.php @@ -25,9 +25,9 @@ class Submit extends AbstractProcessor { foreach ($this->values[$entityName] ?? [] as $values) { $entityValues[$entity['type']][$entityName][] = $values + ['fields' => []]; // Predetermined values override submitted values - if (!empty($entity['af-values'])) { + if (!empty($entity['data'])) { foreach ($entityValues[$entity['type']][$entityName] as $index => $vals) { - $entityValues[$entity['type']][$entityName][$index]['fields'] = $entity['af-values'] + $vals['fields']; + $entityValues[$entity['type']][$entityName][$index]['fields'] = $entity['data'] + $vals['fields']; } } } -- 2.25.1