Skip to content

Commit

Permalink
Merge pull request #14010 from colemanw/assetCheck
Browse files Browse the repository at this point in the history
Skip adding core resources when building assets
  • Loading branch information
mattwire authored Apr 14, 2019
2 parents 2e47b4f + 60c3b6e commit e8e6e75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Core/Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,8 @@ public static function isAjaxMode() {
) {
return TRUE;
}
$url = CRM_Utils_System::getUrlPath();
return (strpos($url, 'civicrm/ajax') === 0) || (strpos($url, 'civicrm/angular') === 0);
list($arg0, $arg1) = array_pad(explode('/', CRM_Utils_System::getUrlPath()), 2, '');
return ($arg0 === 'civicrm' && in_array($arg1, ['ajax', 'angularprofiles', 'asset']));
}

/**
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 @@ -350,6 +350,7 @@ public function ajaxModeData() {
return array(
array(array('q' => 'civicrm/ajax/foo'), TRUE),
array(array('q' => 'civicrm/angularprofiles/template'), TRUE),
array(array('q' => 'civicrm/asset/builder'), 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 e8e6e75

Please sign in to comment.