Merge branch 'fix'

This commit is contained in:
Yuri Kuznetsov
2022-09-21 14:45:32 +03:00
14 changed files with 66 additions and 23 deletions
+5
View File
@@ -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
@@ -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);
+15 -5
View File
@@ -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,
@@ -1,12 +1,4 @@
{
"assignmentNotificatorClassName": "Espo\\Classes\\AssignmentNotificators\\Email",
"readLoaderClassNameList": [
"Espo\\Classes\\FieldProcessing\\Email\\AddressDataLoader",
"Espo\\Classes\\FieldProcessing\\Email\\UserColumnsLoader"
],
"listLoaderClassNameList": [
"Espo\\Classes\\FieldProcessing\\Email\\StringDataLoader"
],
"massActions": {
"update": {
"allowed": true
@@ -0,0 +1,6 @@
<a
href="#{{scope}}/view/{{model.id}}"
class="link"
data-id="{{model.id}}"
title="{{value}}"
>{{#if value}}{{{value}}}{{else}}{{translate 'None'}}{{/if}}</a>
+1 -1
View File
@@ -994,7 +994,7 @@ function (
resolve(options);
return;
};
}
this.requestUserData(data => {
options = data;
+1 -1
View File
@@ -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 || {};
+2
View File
@@ -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',
+12 -1
View File
@@ -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');
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "espocrm",
"version": "7.2.4",
"version": "7.2.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "espocrm",
"version": "7.2.4",
"version": "7.2.5",
"description": "Open-source CRM.",
"repository": {
"type": "git",
+5
View File
@@ -0,0 +1,5 @@
{
"mandatoryFiles": [
"bin/command"
]
}
+3
View File
@@ -1,4 +1,7 @@
{
"mandatoryFiles": [
"bin/command"
],
"manifest": {
"delete": [
"client/css/espo/espo-vertical.css",