Skip to content

Commit

Permalink
Merge pull request #12921 from colemanw/ajaxMode
Browse files Browse the repository at this point in the history
Fix isAjaxMode to also recognize angular ajax
  • Loading branch information
eileenmcnaughton authored Nov 6, 2018
2 parents 4589b6e + e83561b commit 9ea9527
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Core/Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ public static function isAjaxMode() {
) {
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);
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/CRM/Core/ResourcesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ public function testIsAjaxMode($query, $result) {
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),
Expand Down

0 comments on commit 9ea9527

Please sign in to comment.