From e1aef3ed5b532f31a1ef86f4c5cea7e807e7b5d1 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 13 Sep 2019 20:03:35 -0400 Subject: [PATCH] Add mock testAfform --- ext/afform/core/afform.php | 2 +- ext/afform/mock/ang/testAfform.aff.html | 27 +++++++++++++++++++++++++ ext/afform/mock/ang/testAfform.aff.json | 7 +++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 ext/afform/mock/ang/testAfform.aff.html create mode 100644 ext/afform/mock/ang/testAfform.aff.json diff --git a/ext/afform/core/afform.php b/ext/afform/core/afform.php index 6eb602bc1f..9ea9da18f6 100644 --- a/ext/afform/core/afform.php +++ b/ext/afform/core/afform.php @@ -182,7 +182,7 @@ function afform_civicrm_alterAngular($angular) { foreach (pq('af-field', $doc) as $afField) { /** @var DOMElement $afField */ $fieldName = $afField->getAttribute('name'); - $entityName = pq($afField)->parent('af-fieldset[model]')->attr('model'); // TEST ME + $entityName = pq($afField)->parent('af-fieldset[model]')->attr('model'); if (!preg_match(';^[a-zA-Z0-9\_\-\. ]+$;', $entityName)) { throw new \CRM_Core_Exception("Cannot process $path: malformed entity name ($entityName)"); } diff --git a/ext/afform/mock/ang/testAfform.aff.html b/ext/afform/mock/ang/testAfform.aff.html new file mode 100644 index 0000000000..add785cd58 --- /dev/null +++ b/ext/afform/mock/ang/testAfform.aff.html @@ -0,0 +1,27 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ext/afform/mock/ang/testAfform.aff.json b/ext/afform/mock/ang/testAfform.aff.json new file mode 100644 index 0000000000..5fc368cbcf --- /dev/null +++ b/ext/afform/mock/ang/testAfform.aff.json @@ -0,0 +1,7 @@ +{ + "server_route": "civicrm/test-afform", + "title": "This is a test", + "requires": [ + "af", "afBlock", "afField", "afCore" + ] +} -- 2.25.1