Fix login error due to stale constant in afform_html_civicrm_check()
authorTim Otten <totten@civicrm.org>
Sat, 14 Sep 2019 00:23:16 +0000 (20:23 -0400)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
ext/afform/html/afform_html.php
ext/afform/html/ang/afMoncao.ang.php

index fc81ca2ab4171e7c609902b26ade84284346b38b..f5fcfed3dab6127001c740af7ebbd103b126cd02 100644 (file)
@@ -3,6 +3,10 @@
 require_once 'afform_html.civix.php';
 use CRM_AfformHtml_ExtensionUtil as E;
 
+if (!defined('AFFORM_HTML_MONACO')) {
+  define('AFFORM_HTML_MONACO', 'node_modules/monaco-editor/min/vs');
+}
+
 /**
  * Implements hook_civicrm_config().
  *
@@ -166,7 +170,7 @@ function afform_html_civicrm_navigationMenu(&$menu) {
  * Implements hook_civicrm_check().
  */
 function afform_html_civicrm_check(&$messages) {
-  $dir = E::path(CRM_AfformHtml_Page_HtmlEditor::MONACO_DIR);
+  $dir = E::path(AFFORM_HTML_MONACO);
   if (!file_exists($dir)) {
     $messages[] = new CRM_Utils_Check_Message(
       'afform_html_monaco',
index a1c6c88687b51192fa36836985171ca73062c97a..2f896db75d4f603b458fa69a82ba198deb62a586 100644 (file)
@@ -5,7 +5,7 @@
 
 return array(
   'js' => [
-    'node_modules/monaco-editor/min/vs/loader.js',
+    AFFORM_HTML_MONACO . '/loader.js',
     'ang/afMoncao.js',
     //    'ang/afMoncao/*.js',
     //    'ang/afMoncao/*/*.js',
@@ -15,7 +15,7 @@ return array(
   'requires' => ['crmUi', 'crmUtil'],
   'settings' => [
     'paths' => [
-      'vs' => CRM_AfformHtml_ExtensionUtil::url('node_modules/monaco-editor/min/vs'),
+      'vs' => CRM_AfformHtml_ExtensionUtil::url(AFFORM_HTML_MONACO),
     ],
   ],
   'basePages' => [],