From 8f245854f571d7f49f440d13f871f8b8e8065042 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 28 Oct 2019 13:38:22 -0400 Subject: [PATCH] Fix forms autofill with new dataModel The formDataModel is now an object rather than an array. This also changes the array key to match what's used in testAfform.aff.html: url-autofill instead of af-url-autofill --- ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php b/ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php index e8729f73ff..4fb2698117 100644 --- a/ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php +++ b/ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php @@ -45,9 +45,10 @@ abstract class AbstractProcessor extends \Civi\Api4\Generic\AbstractAction { */ protected function validateArgs() { $rawArgs = $this->args; + $entities = $this->_formDataModel->getEntities(); $this->args = []; foreach ($rawArgs as $arg => $val) { - if (!empty($this->_formDataModel[$arg]['af-url-autofill'])) { + if (!empty($entities[$arg]['url-autofill'])) { $this->args[$arg] = $val; } } -- 2.25.1