From e83561bf12ac0c4ebf7001602755ad274d234dfd Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 10 Oct 2018 11:30:06 -0400 Subject: [PATCH] Fix isAjaxMode to also recognize angular ajax --- CRM/Core/Resources.php | 3 ++- tests/phpunit/CRM/Core/ResourcesTest.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index 7436cb682a..fe5c08f7e0 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -794,7 +794,8 @@ class CRM_Core_Resources { ) { return TRUE; } - return strpos(CRM_Utils_System::getUrlPath(), 'civicrm/ajax') === 0; + $url = CRM_Utils_System::getUrlPath(); + return (strpos($url, 'civicrm/ajax') === 0) || (strpos($url, 'civicrm/angular') === 0); } /** diff --git a/tests/phpunit/CRM/Core/ResourcesTest.php b/tests/phpunit/CRM/Core/ResourcesTest.php index 6b11ac2c37..57c1675fdc 100644 --- a/tests/phpunit/CRM/Core/ResourcesTest.php +++ b/tests/phpunit/CRM/Core/ResourcesTest.php @@ -339,6 +339,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { public function ajaxModeData() { return array( array(array('q' => 'civicrm/ajax/foo'), TRUE), + array(array('q' => 'civicrm/angularprofiles/template'), TRUE), array(array('q' => 'civicrm/test/page'), FALSE), array(array('q' => 'civicrm/test/page', 'snippet' => 'json'), TRUE), array(array('q' => 'civicrm/test/page', 'snippet' => 'foo'), FALSE), -- 2.25.1