diff --git a/application/Espo/Core/Utils/Metadata.php b/application/Espo/Core/Utils/Metadata.php index bb32fc5cec..703b552914 100644 --- a/application/Espo/Core/Utils/Metadata.php +++ b/application/Espo/Core/Utils/Metadata.php @@ -196,23 +196,14 @@ class Metadata */ public function set($data, $type, $scope) { - $fullPath = $this->paths['corePath']; + $path = $this->paths['corePath']; $moduleName = $this->getScopeModuleName($scope); if ($moduleName !== false) { - $fullPath = str_replace('{*}', $moduleName, $this->paths['modulePath']); - } - $fullPath = Util::concatPath($fullPath, $type); + $path = str_replace('{*}', $moduleName, $this->paths['modulePath']); + } - //merge data with defaults values - $defaults = $this->getUniteFiles()->loadDefaultValues($type, 'metadata'); - - $decoded = Json::getArrayData($data); - $this->meta = Util::merge($defaults, $decoded); - $data= Json::encode($this->meta); - //END: merge data with defaults values - - $result= $this->getFileManager()->putContents(array($fullPath, $scope.'.json'), $data); + $result= $this->getFileManager()->putContents(array($path, $type, $scope.'.json'), $data); return $result; } @@ -301,7 +292,6 @@ class Metadata /** * Get Scopes - * * * @return array */ @@ -315,7 +305,7 @@ class Metadata $metadata = $this->getMetadataOnly(false); $scopes = array(); - foreach($metadata['scopes'] as $name => $details) { + foreach ($metadata['scopes'] as $name => $details) { $scopes[$name] = isset($details['module']) ? $details['module'] : false; } @@ -366,10 +356,7 @@ class Metadata { $moduleName = $this->getScopeModuleName($scopeName); - $path = 'Espo'; - if ($moduleName !== false) { - $path = str_replace('{*}', $moduleName, $this->getConfig()->get('espoModulePath')); - } + $path = ($moduleName !== false) ? 'Espo/Modules/'.$moduleName : 'Espo'; if ($delim != '/') { $path = str_replace('/', $delim, $path); @@ -379,25 +366,12 @@ class Metadata } /** - * Get Full Scope path, ex. "application/Modules/Crm" for Account - * - * @param string $scopeName - * @param string $delim - delimiter - * - * @return string - */ - public function getScopePathFull($scopeName, $delim = '/') - { - return Util::concatPath('application', $this->getScopePath($scopeName, $delim)); - } - - /** - * Check if scope exists - * - * @param string $scopeName - * - * @return bool - */ + * Check if scope exists + * + * @param string $scopeName + * + * @return bool + */ public function isScopeExists($scopeName) { $scopeModuleMap= $this->getScopes(); diff --git a/application/Espo/Core/defaults/config.php b/application/Espo/Core/defaults/config.php index 38c9412b5b..c23306f8e8 100644 --- a/application/Espo/Core/defaults/config.php +++ b/application/Espo/Core/defaults/config.php @@ -3,12 +3,8 @@ return array ( 'configPath' => 'application/config.php', - 'customDir' => 'application/Espo/Custom', 'cachePath' => 'data/cache', - 'espoModulePath' => 'Espo/Modules/{*}', - 'espoCustomPath' => 'Espo/Custom', - 'languageConfig' => array ( 'name' => '{lang}', @@ -55,11 +51,7 @@ return array ( 'cachePath', 'languageConfig', 'database', - 'customPath', - 'crud', - 'customDir', - 'espoModulePath', - 'espoCustomPath', + 'crud', ), 'adminItems' => array ( diff --git a/application/Espo/Core/defaults/metadata/Defs.json b/application/Espo/Core/defaults/metadata/Defs.json deleted file mode 100644 index 8b13789179..0000000000 --- a/application/Espo/Core/defaults/metadata/Defs.json +++ /dev/null @@ -1 +0,0 @@ - diff --git a/application/Espo/Core/defaults/metadata/FieldDefs.json b/application/Espo/Core/defaults/metadata/FieldDefs.json deleted file mode 100644 index 3b71036421..0000000000 --- a/application/Espo/Core/defaults/metadata/FieldDefs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name":"TestModuleName", - "var1": { - "subvar1":"subval1", - "subvar2":"subval2" - } -} \ No newline at end of file diff --git a/application/Espo/Core/defaults/metadata/RecordDefs.json b/application/Espo/Core/defaults/metadata/RecordDefs.json deleted file mode 100644 index 3b71036421..0000000000 --- a/application/Espo/Core/defaults/metadata/RecordDefs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name":"TestModuleName", - "var1": { - "subvar1":"subval1", - "subvar2":"subval2" - } -} \ No newline at end of file diff --git a/application/Espo/Core/defaults/metadata/customTest.json b/application/Espo/Core/defaults/metadata/customTest.json deleted file mode 100644 index 7836267fad..0000000000 --- a/application/Espo/Core/defaults/metadata/customTest.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name":"CustomTestModuleName", - "var1": { - "subvar1":"subval1", - "subvar2":"subval2" - } -}