From 9ee32530cac57bfae86ee36587528d3d1dc1593b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 7 Apr 2014 14:23:08 -0400 Subject: [PATCH] CoreResources - Look fo non-mini js file when in debug mode --- CRM/Core/Resources.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index 04d2ae505d..c46b955e7d 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -159,6 +159,13 @@ class CRM_Core_Resources { if ($translate) { $this->translateScript($ext, $file); } + // Look for non-minified version if we are in debug mode + if (CRM_Core_Config::singleton()->debug && strpos($file, '.min.js') !== FALSE) { + $nonMiniFile = str_replace('.min.js', '.js', $file); + if ($this->getPath($ext, $nonMiniFile)) { + $file = $nonMiniFile; + } + } return $this->addScriptUrl($this->getUrl($ext, $file, TRUE), $weight, $region); } @@ -563,6 +570,7 @@ class CRM_Core_Resources { public function coreResourceList() { $config = CRM_Core_Config::singleton(); // Use minified files for production, uncompressed in debug mode + // Note, $this->addScriptFile would automatically search for the non-minified file in debug mode but this is probably faster $min = $config->debug ? '' : '.min'; // Scripts needed by everyone, everywhere -- 2.25.1