From f533c68c9bd853895190b71d6beebb5cab83c1f6 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 19 Sep 2022 15:37:52 +0300 Subject: [PATCH 01/11] fix enum empty value not selected --- client/src/view-helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/view-helper.js b/client/src/view-helper.js index 7ffd63e605..5c5190c205 100644 --- a/client/src/view-helper.js +++ b/client/src/view-helper.js @@ -437,7 +437,7 @@ function (marked, DOMPurify, /** typeof Handlebars */Handlebars) { return value.indexOf(name) !== -1; } - return value === name; + return value === name || !value && !name; }; options.hash = options.hash || {}; From e62595183167da6c360f795e037458d1fb3cf288 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 20 Sep 2022 12:14:28 +0300 Subject: [PATCH 02/11] array link-list fix --- client/res/templates/fields/array/list-link.tpl | 6 ++++++ client/src/views/fields/array.js | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 client/res/templates/fields/array/list-link.tpl diff --git a/client/res/templates/fields/array/list-link.tpl b/client/res/templates/fields/array/list-link.tpl new file mode 100644 index 0000000000..9049308f4f --- /dev/null +++ b/client/res/templates/fields/array/list-link.tpl @@ -0,0 +1,6 @@ +{{#if value}}{{{value}}}{{else}}{{translate 'None'}}{{/if}} diff --git a/client/src/views/fields/array.js b/client/src/views/fields/array.js index 062d6b15c3..3115a7dd6f 100644 --- a/client/src/views/fields/array.js +++ b/client/src/views/fields/array.js @@ -43,6 +43,8 @@ function (Dep, RegExpPattern, /** module:ui/multi-select*/MultiSelect) { listTemplate: 'fields/array/list', + listLinkTemplate: 'fields/array/list-link', + detailTemplate: 'fields/array/detail', editTemplate: 'fields/array/edit', From a03a13d3b91dbec54d2fb0e9b4310dff0eabafe6 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 20 Sep 2022 17:05:11 +0300 Subject: [PATCH 03/11] fix auth token error 500 --- application/Espo/Resources/metadata/recordDefs/AuthToken.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/application/Espo/Resources/metadata/recordDefs/AuthToken.json b/application/Espo/Resources/metadata/recordDefs/AuthToken.json index 9e75be28c1..08f1fc3360 100644 --- a/application/Espo/Resources/metadata/recordDefs/AuthToken.json +++ b/application/Espo/Resources/metadata/recordDefs/AuthToken.json @@ -1,11 +1,8 @@ { "assignmentNotificatorClassName": "Espo\\Classes\\AssignmentNotificators\\Email", "readLoaderClassNameList": [ - "Espo\\Classes\\FieldProcessing\\Email\\AddressDataLoader", - "Espo\\Classes\\FieldProcessing\\Email\\UserColumnsLoader" ], "listLoaderClassNameList": [ - "Espo\\Classes\\FieldProcessing\\Email\\StringDataLoader" ], "massActions": { "update": { From 3fed41543774611e0fcfea85d738accf2131fb01 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 20 Sep 2022 17:18:22 +0300 Subject: [PATCH 04/11] clnup --- .../Espo/Resources/metadata/recordDefs/AuthToken.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/application/Espo/Resources/metadata/recordDefs/AuthToken.json b/application/Espo/Resources/metadata/recordDefs/AuthToken.json index 08f1fc3360..9e77ee7f65 100644 --- a/application/Espo/Resources/metadata/recordDefs/AuthToken.json +++ b/application/Espo/Resources/metadata/recordDefs/AuthToken.json @@ -1,9 +1,4 @@ { - "assignmentNotificatorClassName": "Espo\\Classes\\AssignmentNotificators\\Email", - "readLoaderClassNameList": [ - ], - "listLoaderClassNameList": [ - ], "massActions": { "update": { "allowed": true From d12865bbcbb3a15b9bb5ea90f50de93566a6716c Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 20 Sep 2022 18:10:38 +0300 Subject: [PATCH 05/11] lf command --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitattributes b/.gitattributes index ce1d2a3266..a214b04574 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,4 +8,9 @@ *.tpl text eol=crlf *.html text eol=crlf +bin/command text eol=lf + +.gitattributes text eol=crlf +.gitignore text eol=crlf + *.png binary From 5dcd25946b1aea245093dd6b6e04a84f3e8323a6 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 20 Sep 2022 20:09:15 +0300 Subject: [PATCH 06/11] diff mandatory files --- js/diff.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/diff.js b/js/diff.js index 6e5a469b8c..cf34bedc7f 100644 --- a/js/diff.js +++ b/js/diff.js @@ -253,7 +253,7 @@ class Diff process.chdir(buildPath); - let fileList = []; + let fileList = upgradeData.mandatoryFiles || []; let stdout = cp.execSync('git diff --name-only ' + versionFrom).toString(); From c64a107ad9d4f2e381746057a24b4ba19742b1db Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 20 Sep 2022 20:20:54 +0300 Subject: [PATCH 07/11] dif docs --- diff.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/diff.js b/diff.js index 9081e8c8dd..3950eed570 100644 --- a/diff.js +++ b/diff.js @@ -31,8 +31,19 @@ * From a specified version to the current version or all packages needed for a release. * Examples: - * * `node diff 5.9.0` - builds an upgrade from 5.9.0 to the current version; + * * `node diff 5.9.0` - builds an upgrade from 5.9.0 to the current version; * * `node diff --all` - builds all upgrades needed for a release. + * + * Data for upgrade packages is defined in `upgrades/{x.x|x.x.x-x.x.x}/data.json`. + * + * Parameters: + * * `mandatoryFiles` – {string[]} – mandatory files to include in upgrade + * (even files that were not changed in version control); + * * `beforeUpgradeFiles` – {string[]} – files to copy in the beginning of the upgrade process; + * * `manifest` – {object} – upgrade manifest parameters. + * + * Manifest parameters: + * * `delete` – {string[]} – additional files to be deleted (usually those that are not in version control). */ const Diff = require('./js/diff'); From 926410d58f4aac42bb313488b784d86d28caf8ef Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 20 Sep 2022 20:21:11 +0300 Subject: [PATCH 08/11] upgrade file --- upgrades/7.2.4-7.2.5/data.json | 5 +++++ upgrades/7.2/data.json | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 upgrades/7.2.4-7.2.5/data.json diff --git a/upgrades/7.2.4-7.2.5/data.json b/upgrades/7.2.4-7.2.5/data.json new file mode 100644 index 0000000000..8e6c987429 --- /dev/null +++ b/upgrades/7.2.4-7.2.5/data.json @@ -0,0 +1,5 @@ +{ + "mandatoryFiles": [ + "bin/command" + ] +} diff --git a/upgrades/7.2/data.json b/upgrades/7.2/data.json index 533bf63be5..fa1239f4aa 100644 --- a/upgrades/7.2/data.json +++ b/upgrades/7.2/data.json @@ -1,4 +1,7 @@ { + "mandatoryFiles": [ + "bin/command" + ], "manifest": { "delete": [ "client/css/espo/espo-vertical.css", From 9c20116c9b4aed11c23693493b2b81667ae0030a Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 20 Sep 2022 20:21:47 +0300 Subject: [PATCH 09/11] v --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 99434f65dd..44cdd5dff6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "7.2.4", + "version": "7.2.5", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 87433f1dca..ef9fa28615 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "7.2.4", + "version": "7.2.5", "description": "Open-source CRM.", "repository": { "type": "git", From 4dd540ffc7c8ea8b3540522cd1fd8f5ee5906479 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 21 Sep 2022 11:27:36 +0300 Subject: [PATCH 10/11] cleanup --- client/src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app.js b/client/src/app.js index 803a80ff1b..551cee8df2 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -970,7 +970,7 @@ function ( resolve(options); return; - }; + } this.requestUserData(data => { options = data; From 8fd44acae24d714fde9cb5d8976181232d925db1 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 21 Sep 2022 14:40:28 +0300 Subject: [PATCH 11/11] entry point 404 --- .../Core/EntryPoint/EntryPointManager.php | 17 ++++++++++++---- application/Espo/Core/EntryPoint/Starter.php | 20 ++++++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/application/Espo/Core/EntryPoint/EntryPointManager.php b/application/Espo/Core/EntryPoint/EntryPointManager.php index c1f465e088..a4020cd829 100644 --- a/application/Espo/Core/EntryPoint/EntryPointManager.php +++ b/application/Espo/Core/EntryPoint/EntryPointManager.php @@ -32,6 +32,7 @@ namespace Espo\Core\EntryPoint; use Espo\Core\Exceptions\NotFound; use Espo\Core\{ + Exceptions\NotFoundSilent, InjectableFactory, Utils\ClassFinder, Api\Request, @@ -44,7 +45,6 @@ use Espo\Core\{ class EntryPointManager { private InjectableFactory $injectableFactory; - private ClassFinder $classFinder; public function __construct(InjectableFactory $injectableFactory, ClassFinder $classFinder) @@ -53,12 +53,15 @@ class EntryPointManager $this->classFinder = $classFinder; } + /** + * @throws NotFound + */ public function checkAuthRequired(string $name): bool { $className = $this->getClassName($name); if (!$className) { - throw new NotFound("Entry point '{$name}' not found."); + throw new NotFoundSilent("Entry point '{$name}' not found."); } $noAuth = false; @@ -75,23 +78,29 @@ class EntryPointManager return $className::$authRequired ?? true; } + /** + * @throws NotFound + */ public function checkNotStrictAuth(string $name): bool { $className = $this->getClassName($name); if (!$className) { - throw new NotFound("Entry point '{$name}' not found."); + throw new NotFoundSilent("Entry point '{$name}' not found."); } return $className::$notStrictAuth ?? false; } + /** + * @throws NotFound + */ public function run(string $name, Request $request, Response $response): void { $className = $this->getClassName($name); if (!$className) { - throw new NotFound("Entry point '{$name}' not found."); + throw new NotFoundSilent("Entry point '{$name}' not found."); } $entryPoint = $this->injectableFactory->create($className); diff --git a/application/Espo/Core/EntryPoint/Starter.php b/application/Espo/Core/EntryPoint/Starter.php index aeee9c11ae..eb4fedb7e3 100644 --- a/application/Espo/Core/EntryPoint/Starter.php +++ b/application/Espo/Core/EntryPoint/Starter.php @@ -33,6 +33,7 @@ use Espo\Core\Exceptions\BadRequest; use Espo\Core\Application\Runner\Params as RunnerParams; use Espo\Core\EntryPoint\EntryPointManager; use Espo\Core\ApplicationUser; +use Espo\Core\Exceptions\NotFound; use Espo\Core\Portal\Application as PortalApplication; use Espo\Core\Authentication\AuthenticationFactory; use Espo\Core\Authentication\AuthToken\Manager as AuthTokenManager; @@ -89,7 +90,7 @@ class Starter /** * @throws BadRequest - * @throws \Espo\Core\Exceptions\NotFound + * @throws NotFound */ public function start(?string $entryPoint = null, bool $final = false): void { @@ -110,8 +111,19 @@ class Starter throw new BadRequest("No 'entryPoint' param."); } - $authRequired = $this->entryPointManager->checkAuthRequired($entryPoint); - $authNotStrict = $this->entryPointManager->checkNotStrictAuth($entryPoint); + $responseWrapped = new ResponseWrapper(new Response()); + + try { + $authRequired = $this->entryPointManager->checkAuthRequired($entryPoint); + $authNotStrict = $this->entryPointManager->checkNotStrictAuth($entryPoint); + } + catch (NotFound $exception) { + $this->errorOutput->processWithBodyPrinting($requestWrapped, $responseWrapped, $exception); + + (new ResponseEmitter())->emit($responseWrapped->getResponse()); + + return; + } if ($authRequired && !$authNotStrict && !$final) { $portalId = $this->detectPortalId($requestWrapped); @@ -123,8 +135,6 @@ class Starter } } - $responseWrapped = new ResponseWrapper(new Response()); - $this->processRequest( $entryPoint, $requestWrapped,