From 8981b6ac1b440a3410fd12b78cc22abbdb80d028 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 13 Sep 2019 20:36:21 -0400 Subject: [PATCH] af/Form.js - Use the canonical name for API calls --- ext/afform/core/CRM/Afform/Page/AfformBase.php | 1 + ext/afform/core/ang/af/Form.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/afform/core/CRM/Afform/Page/AfformBase.php b/ext/afform/core/CRM/Afform/Page/AfformBase.php index 3d389528b6..8684e04315 100644 --- a/ext/afform/core/CRM/Afform/Page/AfformBase.php +++ b/ext/afform/core/CRM/Afform/Page/AfformBase.php @@ -13,6 +13,7 @@ class CRM_Afform_Page_AfformBase extends CRM_Core_Page { $loader->setPageName(implode('/', $pagePath)); $loader->getRes()->addSetting([ 'afform' => [ + 'name' => $pageArgs['afform'], 'open' => _afform_angular_module_name($pageArgs['afform'], 'dash'), ], ]); diff --git a/ext/afform/core/ang/af/Form.js b/ext/afform/core/ang/af/Form.js index a8196bfccd..304ea43e0e 100644 --- a/ext/afform/core/ang/af/Form.js +++ b/ext/afform/core/ang/af/Form.js @@ -45,7 +45,7 @@ } }); if (toLoad) { - crmApi4('Afform', 'prefill', {name: CRM.afform.open, args: $routeParams}) + crmApi4('Afform', 'prefill', {name: CRM.afform.name, args: $routeParams}) .then(function(result) { _.each(result, function(item) { data[item.name] = _.extend(item.values, schema[item.name].data || {}); @@ -55,7 +55,7 @@ }; this.submit = function submit() { - crmApi4('Afform', 'submit', {name: CRM.afform.open, args: $routeParams, values: data}); + crmApi4('Afform', 'submit', {name: CRM.afform.name, args: $routeParams, values: data}); }; } }; -- 2.25.1