From e2c087f34b350615b3ce7726e143ac896e39aef3 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 19 Dec 2008 01:30:02 +0000 Subject: [PATCH] Fixing failing tests in JavascriptHelper. git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7944 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/javascript.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index a9bde2a42..af7e37b9e 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -433,16 +433,19 @@ class JavascriptHelper extends AppHelper { $out = ''; $rules = array(); + if (!$this->_cacheEvents) { + return; + } $data = $this->getCache(); - if (!$this->_cacheEvents || empty($data)) { + + if (empty($data)) { return; } if ($this->_cacheToFile) { $filename = md5($data); if (!file_exists(JS . $filename . '.js')) { - $filePath = str_replace(WWW_ROOT, '', JS) . $filename . '.js'; - cache($filePath, $data, '+999 days', 'public'); + cache(str_replace(WWW_ROOT, '', JS) . $filename . '.js', $data, '+999 days', 'public'); } $out = $this->link($filename); } else {