From 785bc0ed6ebdfe012b66649164168bc725113ddc Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 27 Jan 2023 16:47:37 +0200 Subject: [PATCH 1/7] update async --- composer.json | 2 +- composer.lock | 151 ++++++++++++++++++++++++-------------------------- 2 files changed, 74 insertions(+), 79 deletions(-) diff --git a/composer.json b/composer.json index 415e1a06f0..dabdfb06ff 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "yzalis/identicon": "*", "zordius/lightncandy": "dev-espo#v1.2.5e", "composer/semver": "^3", - "spatie/async": "1.5.3", + "spatie/async": "1.5.5", "tecnickcom/tcpdf": "6.3.5", "symfony/process": "4.4.*", "symfony/http-foundation": "4.4.*", diff --git a/composer.lock b/composer.lock index 3dab946232..7e144840af 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b8579baeb6ecd7fa882bd35e9a2d85de", + "content-hash": "9e7630c5c6bca8d8d99ca27b546df824", "packages": [ { "name": "async-aws/core", @@ -1635,6 +1635,66 @@ ], "time": "2022-11-14T08:50:44+00:00" }, + { + "name": "laravel/serializable-closure", + "version": "v1.2.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae", + "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "nesbot/carbon": "^2.61", + "pestphp/pest": "^1.21.3", + "phpstan/phpstan": "^1.8.2", + "symfony/var-dumper": "^5.4.11" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2022-09-08T13:45:54+00:00" + }, { "name": "league/flysystem", "version": "2.1.1", @@ -2450,71 +2510,6 @@ }, "time": "2018-02-13T20:26:39+00:00" }, - { - "name": "opis/closure", - "version": "3.6.1", - "source": { - "type": "git", - "url": "https://github.com/opis/closure.git", - "reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5", - "reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5", - "shasum": "" - }, - "require": { - "php": "^5.4 || ^7.0 || ^8.0" - }, - "require-dev": { - "jeremeamia/superclosure": "^2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "Opis\\Closure\\": "src/" - }, - "files": [ - "functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marius Sarca", - "email": "marius.sarca@gmail.com" - }, - { - "name": "Sorin Sarca", - "email": "sarca_sorin@hotmail.com" - } - ], - "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.", - "homepage": "https://opis.io/closure", - "keywords": [ - "anonymous functions", - "closure", - "function", - "serializable", - "serialization", - "serialize" - ], - "support": { - "issues": "https://github.com/opis/closure/issues", - "source": "https://github.com/opis/closure/tree/3.6.1" - }, - "time": "2020-11-07T02:01:34+00:00" - }, { "name": "paragonie/constant_time_encoding", "version": "v2.6.3", @@ -4057,27 +4052,27 @@ }, { "name": "spatie/async", - "version": "1.5.3", + "version": "1.5.5", "source": { "type": "git", "url": "https://github.com/spatie/async.git", - "reference": "d371b76ff876530c4906596490fd977720477e48" + "reference": "742708736b1e6d606dd1cd0f60acb7e354211e41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/async/zipball/d371b76ff876530c4906596490fd977720477e48", - "reference": "d371b76ff876530c4906596490fd977720477e48", + "url": "https://api.github.com/repos/spatie/async/zipball/742708736b1e6d606dd1cd0f60acb7e354211e41", + "reference": "742708736b1e6d606dd1cd0f60acb7e354211e41", "shasum": "" }, "require": { - "opis/closure": "^3.4.2", - "php": "^7.1 || ^8.0", - "symfony/process": "^3.3 || ^4.0 || ^5.0" + "laravel/serializable-closure": "^1.0", + "php": "^7.4|^8.0", + "symfony/process": "^3.3 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { "larapack/dd": "^1.1", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", - "symfony/stopwatch": "^4.0 || ^5.0" + "phpunit/phpunit": "^7.5 || ^8.5.21 || ^9.0", + "symfony/stopwatch": "^4.0 || ^5.0 || ^6.0" }, "suggest": { "ext-pcntl": "Required to use async processes", @@ -4112,7 +4107,7 @@ ], "support": { "issues": "https://github.com/spatie/async/issues", - "source": "https://github.com/spatie/async/tree/1.5.3" + "source": "https://github.com/spatie/async/tree/1.5.5" }, "funding": [ { @@ -4120,7 +4115,7 @@ "type": "github" } ], - "time": "2020-12-29T22:19:12+00:00" + "time": "2022-06-21T06:40:45+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7702,5 +7697,5 @@ "ext-pdo": "*" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.3.0" } From b6e7f5113f4dbb6cce0f29810804446f6e2fedfe Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 29 Jan 2023 10:17:38 +0200 Subject: [PATCH 2/7] prevent shortcut pagination if focused of form element --- client/src/views/modals/detail.js | 8 ++++++++ client/src/views/record/detail.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/client/src/views/modals/detail.js b/client/src/views/modals/detail.js index 978baff233..902c69f242 100644 --- a/client/src/views/modals/detail.js +++ b/client/src/views/modals/detail.js @@ -715,6 +715,10 @@ define('views/modals/detail', ['views/modal', 'helpers/action-item-setup'], func return; } + if (e.target.tagName === 'TEXTAREA' || e.target.tagName === 'INPUT') { + return; + } + e.preventDefault(); e.stopPropagation(); @@ -734,6 +738,10 @@ define('views/modals/detail', ['views/modal', 'helpers/action-item-setup'], func return; } + if (e.target.tagName === 'TEXTAREA' || e.target.tagName === 'INPUT') { + return; + } + e.preventDefault(); e.stopPropagation(); diff --git a/client/src/views/record/detail.js b/client/src/views/record/detail.js index e4dc504974..e0da518c80 100644 --- a/client/src/views/record/detail.js +++ b/client/src/views/record/detail.js @@ -3965,6 +3965,10 @@ function (Dep, ViewRecordHelper, ActionItemSetup) { return; } + if (e.target.tagName === 'TEXTAREA' || e.target.tagName === 'INPUT') { + return; + } + let $button = this.$el.find('button[data-action="previous"]'); if (!$button.length || $button.hasClass('disabled')) { @@ -3994,6 +3998,10 @@ function (Dep, ViewRecordHelper, ActionItemSetup) { return; } + if (e.target.tagName === 'TEXTAREA' || e.target.tagName === 'INPUT') { + return; + } + let $button = this.$el.find('button[data-action="next"]'); if (!$button.length || $button.hasClass('disabled')) { From fe3ab8b8a0e4db7421678fac294de44f5bf91310 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 30 Jan 2023 21:07:43 +0200 Subject: [PATCH 3/7] fix invalid null --- .../Espo/Core/FieldProcessing/EmailAddress/Saver.php | 4 ++-- .../Espo/Core/FieldProcessing/PhoneNumber/Saver.php | 4 ++-- client/src/views/fields/email.js | 8 ++++++++ client/src/views/fields/phone.js | 8 ++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php b/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php index 342ee9e912..4439a8f15b 100644 --- a/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php +++ b/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php @@ -152,7 +152,7 @@ class Saver implements SaverInterface $key = strtolower($emailAddressValue); if ($key && isset($hash->$key)) { - $hash->{$key}['optOut'] = $entity->get('emailAddressIsOptedOut'); + $hash->{$key}['optOut'] = (bool) $entity->get('emailAddressIsOptedOut'); } } @@ -170,7 +170,7 @@ class Saver implements SaverInterface $key = strtolower($emailAddressValue); if ($key && isset($hash->$key)) { - $hash->{$key}['invalid'] = $entity->get('emailAddressIsInvalid'); + $hash->{$key}['invalid'] = (bool) $entity->get('emailAddressIsInvalid'); } } diff --git a/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php b/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php index 1011bc5d46..0b93ac88b7 100644 --- a/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php +++ b/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php @@ -163,7 +163,7 @@ class Saver implements SaverInterface $key = $phoneNumberValue; if (isset($hash->$key)) { - $hash->{$key}['optOut'] = $entity->get('phoneNumberIsOptedOut'); + $hash->{$key}['optOut'] = (bool) $entity->get('phoneNumberIsOptedOut'); } } @@ -180,7 +180,7 @@ class Saver implements SaverInterface $key = $phoneNumberValue; if (isset($hash->$key)) { - $hash->{$key}['invalid'] = $entity->get('phoneNumberIsInvalid'); + $hash->{$key}['invalid'] = (bool) $entity->get('phoneNumberIsInvalid'); } } diff --git a/client/src/views/fields/email.js b/client/src/views/fields/email.js index a2f857797b..1c8699d56d 100644 --- a/client/src/views/fields/email.js +++ b/client/src/views/fields/email.js @@ -156,6 +156,7 @@ define('views/fields/email', ['views/fields/varchar'], function (Dep) { if (this.isReadMode()) { data.isOptedOut = this.model.get(this.isOptedOutFieldName); + data.isInvalid = this.model.get(this.isInvalidFieldName); if (this.model.get(this.name)) { data.isErased = this.model.get(this.name).indexOf(this.erasedPlaceholder) === 0 @@ -509,6 +510,7 @@ define('views/fields/email', ['views/fields/varchar'], function (Dep) { setup: function () { this.dataFieldName = this.name + 'Data'; this.isOptedOutFieldName = this.name + 'IsOptedOut'; + this.isInvalidFieldName = this.name + 'IsInvalid'; this.erasedPlaceholder = 'ERASED:'; @@ -555,6 +557,7 @@ define('views/fields/email', ['views/fields/varchar'], function (Dep) { data[this.dataFieldName] = addressData; data[this.name] = null; data[this.isOptedOutFieldName] = false; + data[this.isInvalidFieldName] = false; let primaryIndex = 0; @@ -565,6 +568,10 @@ define('views/fields/email', ['views/fields/varchar'], function (Dep) { if (item.optOut) { data[this.isOptedOutFieldName] = true; } + + if (item.invalid) { + data[this.isInvalidFieldName] = true; + } } }); @@ -579,6 +586,7 @@ define('views/fields/email', ['views/fields/varchar'], function (Dep) { data[this.name] = addressData[0].emailAddress; } else { data[this.isOptedOutFieldName] = null; + data[this.isInvalidFieldName] = null; } return data; diff --git a/client/src/views/fields/phone.js b/client/src/views/fields/phone.js index 8c9f87f747..1a62fa1e28 100644 --- a/client/src/views/fields/phone.js +++ b/client/src/views/fields/phone.js @@ -176,6 +176,7 @@ function (Dep, /** module:ui/select*/Select) { if (this.isReadMode()) { data.isOptedOut = this.model.get(this.isOptedOutFieldName); + data.isInvalid = this.model.get(this.isInvalidFieldName); if (this.model.get(this.name)) { data.isErased = this.model.get(this.name).indexOf(this.erasedPlaceholder) === 0; @@ -409,6 +410,7 @@ function (Dep, /** module:ui/select*/Select) { .get('entityDefs.' + this.model.name + '.fields.' + this.name + '.defaultType'); this.isOptedOutFieldName = this.name + 'IsOptedOut'; + this.isInvalidFieldName = this.name + 'IsInvalid'; this.phoneNumberOptedOutByDefault = this.getConfig().get('phoneNumberIsOptedOutByDefault'); @@ -468,6 +470,7 @@ function (Dep, /** module:ui/select*/Select) { data[this.dataFieldName] = addressData; data[this.name] = null; data[this.isOptedOutFieldName] = false; + data[this.isInvalidFieldName] = false; let primaryIndex = 0; @@ -478,6 +481,10 @@ function (Dep, /** module:ui/select*/Select) { if (item.optOut) { data[this.isOptedOutFieldName] = true; } + + if (item.invalid) { + data[this.isInvalidFieldName] = true; + } } }); @@ -492,6 +499,7 @@ function (Dep, /** module:ui/select*/Select) { data[this.name] = addressData[0].phoneNumber; } else { data[this.isOptedOutFieldName] = null; + data[this.isInvalidFieldName] = null; } return data; From 5b8ccb4513a9ff3cb3fd00e4228b6eef076d51d2 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 6 Feb 2023 17:10:41 +0200 Subject: [PATCH 4/7] fisable group tabs for portal --- client/src/views/portal/fields/tab-list.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/src/views/portal/fields/tab-list.js b/client/src/views/portal/fields/tab-list.js index 9bae6e163f..9f90fb9907 100644 --- a/client/src/views/portal/fields/tab-list.js +++ b/client/src/views/portal/fields/tab-list.js @@ -26,21 +26,24 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -Espo.define('views/portal/fields/tab-list', 'views/settings/fields/tab-list', function (Dep) { +define('views/portal/fields/tab-list', ['views/settings/fields/tab-list'], function (Dep) { return Dep.extend({ + noGroups: true, + setupOptions: function () { Dep.prototype.setupOptions.call(this); - this.params.options = this.params.options.filter(function (tab) { - if (tab === '_delimiter_') return true; + this.params.options = this.params.options.filter(tab => { + if (tab === '_delimiter_') { + return true; + } + if (!!this.getMetadata().get('scopes.' + tab + '.aclPortal')) { return true; } - }, this); - } - + }); + }, }); - }); From 3fa7ddf9f8142b0cddffb43cc0913a41230d139f Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 6 Feb 2023 17:39:36 +0200 Subject: [PATCH 5/7] fix upgrade --- upgrades/7.3/scripts/BeforeUpgrade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/upgrades/7.3/scripts/BeforeUpgrade.php b/upgrades/7.3/scripts/BeforeUpgrade.php index 73105d65ad..f92e787b89 100644 --- a/upgrades/7.3/scripts/BeforeUpgrade.php +++ b/upgrades/7.3/scripts/BeforeUpgrade.php @@ -102,6 +102,7 @@ class BeforeUpgrade 'assignedUserId' => $user->getId(), 'name' => $emailAddress . ' (auto-created)', 'emailAddress' => $emailAddress, + 'useImap' => false, 'useSmtp' => true, 'status' => 'Active', 'smtpHost' => $smtpServer, From 846b57842fb178c4edfeb9e88a2a7d8c29b4d319 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 7 Feb 2023 09:16:25 +0200 Subject: [PATCH 6/7] 7.3.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1336fcb4d7..1f4c0c411a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "espocrm", - "version": "7.3.2", + "version": "7.3.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "espocrm", - "version": "7.3.2", + "version": "7.3.3", "hasInstallScript": true, "license": "GPL-3.0", "dependencies": { diff --git a/package.json b/package.json index 4e73e352ee..f184844262 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "7.3.2", + "version": "7.3.3", "description": "Open-source CRM.", "repository": { "type": "git", From b8386f3ea31b75f28e9b671b1f6c5e6aa0af762b Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 7 Feb 2023 10:06:05 +0200 Subject: [PATCH 7/7] fix diff --- js/diff.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/js/diff.js b/js/diff.js index 658eda53a4..6d84ed8ecf 100644 --- a/js/diff.js +++ b/js/diff.js @@ -82,6 +82,7 @@ class Diff let minorVersionNumber = version.split('.')[1]; let hotfixVersionNumber = version.split('.')[2]; + let majorVersionNumber = version.split('.')[0]; for (let i = 0; i < tagList.length; i++) { let tag = tagList[i]; @@ -105,16 +106,27 @@ class Diff } } + if (hotfixVersionNumber !== '0') { for (let i = 0; i < tagList.length; i++) { let tag = tagList[i]; let patchVersionNumberI = tag.split('.')[2]; + let minorVersionNumberI = tag.split('.')[1]; + let majorVersionNumberI = tag.split('.')[0]; - if (closest && parseInt(patchVersionNumberI) !== parseInt(hotfixVersionNumber) - 1) { - break; + if ( + closest && + ( + minorVersionNumberI !== minorVersionNumber || + majorVersionNumberI !== majorVersionNumber || + parseInt(patchVersionNumberI) !== parseInt(hotfixVersionNumber) - 1 + ) + ) { + continue; } + if (tag === version) { continue; }