From 3bcaffa1d406372bd8182a767f3a27ee0cddc563 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 23 May 2014 14:23:45 +0300 Subject: [PATCH 1/4] change version to 1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 74e1a378a9..0847bfe9b5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "espocrm", "version": "1.0.0", - "espoVersion": "1.0-rc4", + "espoVersion": "1.0", "description": "", "main": "index.php", "repository": "", From a8adbcf9cf9bd90433ac88bacdd11e541e0321df Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 23 May 2014 14:37:32 +0300 Subject: [PATCH 2/4] no compress in grunt --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b979fe2684..2f0a37c0e7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -129,7 +129,7 @@ module.exports = function (grunt) { 'api/**', 'application/**', 'custom/**', - 'data', + 'data/.data', 'install/**', 'vendor/**', 'bootstrap.php', @@ -218,7 +218,7 @@ module.exports = function (grunt) { 'replace', 'copy:final', 'clean:final', - 'compress', + //'compress', ]); }; From 5e149fdd05cfaf0626c297695d006a11ed76c997 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Thu, 15 May 2014 16:31:12 +0300 Subject: [PATCH 3/4] fixed 'cacheTimestamp' for config changes --- application/Espo/Controllers/Settings.php | 2 -- application/Espo/Core/DataManager.php | 4 +--- application/Espo/Core/Utils/Config.php | 25 +++++++++++++++++++++++ tests/testData/Utils/Config/config.php | 2 +- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/application/Espo/Controllers/Settings.php b/application/Espo/Controllers/Settings.php index 3c495fe137..f84300637b 100644 --- a/application/Espo/Controllers/Settings.php +++ b/application/Espo/Controllers/Settings.php @@ -43,8 +43,6 @@ class Settings extends \Espo\Core\Controllers\Base throw new Error('Cannot save settings'); } - $this->getContainer()->get('dataManager')->updateCacheTimestamp(); - return $this->getConfig()->getData($this->getUser()->isAdmin()); } } diff --git a/application/Espo/Core/DataManager.php b/application/Espo/Core/DataManager.php index 10e3ffeceb..5a1f3a8a68 100644 --- a/application/Espo/Core/DataManager.php +++ b/application/Espo/Core/DataManager.php @@ -121,9 +121,7 @@ class DataManager */ public function updateCacheTimestamp() { - $config = $this->getContainer()->get('config'); - - return $config->set('cacheTimestamp', time()); + return $this->getContainer()->get('config')->updateCacheTimestamp(); } diff --git a/application/Espo/Core/Utils/Config.php b/application/Espo/Core/Utils/Config.php index 933211ace7..ddc3bb62a7 100644 --- a/application/Espo/Core/Utils/Config.php +++ b/application/Espo/Core/Utils/Config.php @@ -34,6 +34,8 @@ class Config protected $configPath = 'data/config.php'; + private $cacheTimestamp = 'cacheTimestamp'; + /** * Array of admin items * @@ -121,6 +123,10 @@ class Config return false; } + if (!isset($values[$this->cacheTimestamp])) { + $values = array_merge($this->updateCacheTimestamp(true), $values); + } + $result = $this->getFileManager()->mergeContentsPHP($this->configPath, $values, true); $this->loadConfig(true); @@ -192,6 +198,25 @@ class Config return $this->setArray($values); } + /** + * Update cache timestamp + * + * @param $onlyValue - If need to return just timestamp array + * @return bool | array + */ + public function updateCacheTimestamp($onlyValue = false) + { + $timestamp = array( + $this->cacheTimestamp => time(), + ); + + if ($onlyValue) { + return $timestamp; + } + + return $this->set($timestamp); + } + /** * Get admin items * diff --git a/tests/testData/Utils/Config/config.php b/tests/testData/Utils/Config/config.php index e0a3a722af..2aae4eb795 100644 --- a/tests/testData/Utils/Config/config.php +++ b/tests/testData/Utils/Config/config.php @@ -144,7 +144,7 @@ return array ( 10 => 'cron', ), 'isInstalled' => true, - 'cacheTimestamp' => 1399456816, + 'cacheTimestamp' => 1400160414, 'testOption' => 'Another Wrong Value', 'testOption2' => 'Test2', ); From 3162df43caa4d6f94945845798b11f1b61945bee Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Thu, 15 May 2014 15:47:47 +0300 Subject: [PATCH 4/4] fixed 'jsonArray' field type issue --- application/Espo/Core/Utils/Database/Schema/Converter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/Espo/Core/Utils/Database/Schema/Converter.php b/application/Espo/Core/Utils/Database/Schema/Converter.php index 6757ce544e..1de10d7421 100644 --- a/application/Espo/Core/Utils/Database/Schema/Converter.php +++ b/application/Espo/Core/Utils/Database/Schema/Converter.php @@ -139,6 +139,7 @@ class Converter } $fieldType = isset($fieldParams['dbType']) ? $fieldParams['dbType'] : $fieldParams['type']; + $fieldType = strtolower($fieldType); /** doctrine uses strtolower for all field types */ if (!in_array($fieldType, $this->typeList)) { $GLOBALS['log']->debug('Converters\Schema::process(): Field type ['.$fieldType.'] does not exist '.$entityName.':'.$fieldName); continue;