af/Form.js - Use the canonical name for API calls
authorTim Otten <totten@civicrm.org>
Sat, 14 Sep 2019 00:36:21 +0000 (20:36 -0400)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
ext/afform/core/CRM/Afform/Page/AfformBase.php
ext/afform/core/ang/af/Form.js

index 3d389528b605092d1f3961d6682536952c11ebfe..8684e0431536baf7acbb3c58e6cd4aab25d65827 100644 (file)
@@ -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'),
       ],
     ]);
index a8196bfccd6bf4996ce3b08941a038092c6b402a..304ea43e0e2d21c5f5a404863ac5a761c0d03e60 100644 (file)
@@ -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});
         };
       }
     };