From 83c642ef42c9626f7465f513014e9ff6c3a03375 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 5 Sep 2025 16:37:26 -0700 Subject: [PATCH 1/6] Clean up error messages --- ProcessMaker/Console/Commands/TenantsList.php | 4 ++++ ProcessMaker/Providers/AuthServiceProvider.php | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ProcessMaker/Console/Commands/TenantsList.php b/ProcessMaker/Console/Commands/TenantsList.php index ddcfefead9..72b24b599d 100644 --- a/ProcessMaker/Console/Commands/TenantsList.php +++ b/ProcessMaker/Console/Commands/TenantsList.php @@ -43,6 +43,10 @@ public function handle() $formattedTenants = $tenants->map(function ($tenant) { $config = $tenant->config; + if (isset($config['app.key'])) { + $config['app.key'] = substr($config['app.key'], 0, 30); + } + // Json encode, pretty print without slashes $config = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); diff --git a/ProcessMaker/Providers/AuthServiceProvider.php b/ProcessMaker/Providers/AuthServiceProvider.php index 48a6ec1c2c..e4e4312321 100644 --- a/ProcessMaker/Providers/AuthServiceProvider.php +++ b/ProcessMaker/Providers/AuthServiceProvider.php @@ -85,6 +85,12 @@ public function boot() public function defineGates() { + // No need to run this in console and it generates + // errors in multitenancy mode + if (app()->runningInConsole()) { + return; + } + try { // Cache the permissions for a day to improve performance $permissions = Cache::remember('permissions', 86400, function () { From 9b95fd3fb44627689aa3b11a0b64d58d616eb18d Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 9 Sep 2025 14:49:35 -0700 Subject: [PATCH 2/6] Make the MT provider run first --- ProcessMaker/Application.php | 15 +++++++++------ ProcessMaker/LicensedPackageManifest.php | 14 ++++++++++++++ ProcessMaker/Multitenancy/SwitchTenant.php | 2 +- ProcessMaker/Providers/AuthServiceProvider.php | 2 +- .../Providers/ProcessMakerServiceProvider.php | 4 ---- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ProcessMaker/Application.php b/ProcessMaker/Application.php index 2c7d4dc77e..023fc26c4f 100644 --- a/ProcessMaker/Application.php +++ b/ProcessMaker/Application.php @@ -3,7 +3,9 @@ namespace ProcessMaker; use Igaster\LaravelTheme\Facades\Theme; +use Illuminate\Filesystem\Filesystem; use Illuminate\Foundation\Application as IlluminateApplication; +use Illuminate\Foundation\PackageManifest; use Illuminate\Support\Facades\Auth; /** @@ -78,13 +80,14 @@ public function path($path = '') return $this->basePath . DIRECTORY_SEPARATOR . 'ProcessMaker' . ($path ? DIRECTORY_SEPARATOR . $path : $path); } - public function setStoragePath($path) + public function registerConfiguredProviders() { - $this->storagePath = $path; - } + // Must be rebound before registerConfiguredProviders() runs but after bootstrapping is done + // so we can access storage and cache facades. + $this->singleton(PackageManifest::class, fn () => new LicensedPackageManifest( + new Filesystem, $this->basePath(), $this->getCachedPackagesPath() + )); - public function getStoragePath() - { - return $this->storagePath; + parent::registerConfiguredProviders(); } } diff --git a/ProcessMaker/LicensedPackageManifest.php b/ProcessMaker/LicensedPackageManifest.php index 3fbc38b297..abed47193e 100644 --- a/ProcessMaker/LicensedPackageManifest.php +++ b/ProcessMaker/LicensedPackageManifest.php @@ -20,6 +20,20 @@ class LicensedPackageManifest extends PackageManifest const LAST_PACKAGE_DISCOVERY = 0; + /** + * Consider this the beginning of licenesing refactor for multitenancy. + * + * For now, this will just move the Spatie MultitenancyServiceProvider to the beginning of the service providers. + */ + protected function getManifest() + { + $manifest = parent::getManifest(); + $multitenancyKey = 'spatie/laravel-multitenancy'; + + // Make sure the MultitenancyServiceProvider is at the beginning of the manifest + return [$multitenancyKey => $manifest[$multitenancyKey]] + $manifest; + } + protected function packagesToIgnore() { $packagesToIgnore = $this->loadPackagesToIgnore()->all(); diff --git a/ProcessMaker/Multitenancy/SwitchTenant.php b/ProcessMaker/Multitenancy/SwitchTenant.php index 2ca2efc3ec..f8486cc791 100644 --- a/ProcessMaker/Multitenancy/SwitchTenant.php +++ b/ProcessMaker/Multitenancy/SwitchTenant.php @@ -39,7 +39,7 @@ public function makeCurrent(IsTenant $tenant): void $tenantStoragePath = base_path('storage/tenant_' . $tenant->id); $app = app(); - $app->setStoragePath($tenantStoragePath); + $app->useStoragePath($tenantStoragePath); // Create the tenant storage directory if it doesn't exist // TODO: Move these to somewhere else - should not be run on every request diff --git a/ProcessMaker/Providers/AuthServiceProvider.php b/ProcessMaker/Providers/AuthServiceProvider.php index e4e4312321..6f0572a392 100644 --- a/ProcessMaker/Providers/AuthServiceProvider.php +++ b/ProcessMaker/Providers/AuthServiceProvider.php @@ -87,7 +87,7 @@ public function defineGates() { // No need to run this in console and it generates // errors in multitenancy mode - if (app()->runningInConsole()) { + if (!app()->environment('testing') && app()->runningInConsole()) { return; } diff --git a/ProcessMaker/Providers/ProcessMakerServiceProvider.php b/ProcessMaker/Providers/ProcessMakerServiceProvider.php index 1c18838a0d..0e2710709e 100644 --- a/ProcessMaker/Providers/ProcessMakerServiceProvider.php +++ b/ProcessMaker/Providers/ProcessMakerServiceProvider.php @@ -259,10 +259,6 @@ public function register(): void // Miscellaneous vendor customization static::configureVendors(); - $this->app->singleton(PackageManifest::class, fn () => new LicensedPackageManifest( - new Filesystem, $this->app->basePath(), $this->app->getCachedPackagesPath() - )); - $this->app->extend(MigrateCommand::class, function () { return new ExtendedMigrateCommand( app('migrator'), From 1d2d08203286e8a02af80362fa994dab10c0378b Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Thu, 4 Sep 2025 17:59:47 -0400 Subject: [PATCH 3/6] FOUR-26094 --- .../js/processes/modeler/components/inspector/StageItem.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/js/processes/modeler/components/inspector/StageItem.vue b/resources/js/processes/modeler/components/inspector/StageItem.vue index 7e12cc7396..a221af98ab 100644 --- a/resources/js/processes/modeler/components/inspector/StageItem.vue +++ b/resources/js/processes/modeler/components/inspector/StageItem.vue @@ -13,9 +13,6 @@ @input="onInput" @paste="onPaste" > - - {{ localName.length }}/200 {{ t('characters') }} -