diff --git a/ProcessMaker/Console/Commands/ProcessMakerLicenseRemove.php b/ProcessMaker/Console/Commands/ProcessMakerLicenseRemove.php index 10019d5d58..3ac6f15baf 100644 --- a/ProcessMaker/Console/Commands/ProcessMakerLicenseRemove.php +++ b/ProcessMaker/Console/Commands/ProcessMakerLicenseRemove.php @@ -3,6 +3,7 @@ namespace ProcessMaker\Console\Commands; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Storage; class ProcessMakerLicenseRemove extends Command @@ -37,6 +38,10 @@ public function handle() if ($this->confirm('Are you sure you want to remove the license.json file?')) { Storage::disk('local')->delete('license.json'); $this->info('license.json removed successfully!'); + + $this->info('Calling package:discover to update the package cache with enabled packages'); + Artisan::call('package:discover'); + $this->info(Artisan::output()); } else { $this->info('Operation cancelled. license.json was not removed.'); } diff --git a/ProcessMaker/Console/Commands/ProcessMakerLicenseUpdate.php b/ProcessMaker/Console/Commands/ProcessMakerLicenseUpdate.php index 0f57fd9ca5..83c1a72a5d 100644 --- a/ProcessMaker/Console/Commands/ProcessMakerLicenseUpdate.php +++ b/ProcessMaker/Console/Commands/ProcessMakerLicenseUpdate.php @@ -42,7 +42,10 @@ public function handle() Storage::disk('local')->put('license.json', $content); + $this->info('Calling package:discover to update the package cache with enabled packages'); Artisan::call('package:discover'); + $this->info(Artisan::output()); + $this->info('License updated successfully'); } catch (Exception $e) { $this->error('An error occurred: ' . $e->getMessage()); @@ -77,6 +80,7 @@ protected function isValidLicenseContent(string $content): bool Carbon::parse($data['expires_at']); } catch (Exception $e) { $this->error('The "expires_at" property is not a valid date.'); + return false; } diff --git a/ProcessMaker/Http/Controllers/HomeController.php b/ProcessMaker/Http/Controllers/HomeController.php index da07bf0ab7..02b48877f8 100644 --- a/ProcessMaker/Http/Controllers/HomeController.php +++ b/ProcessMaker/Http/Controllers/HomeController.php @@ -20,7 +20,7 @@ public function index(Request $request) return redirect('/requests'); } // Redirect to home dynamic only if the package was enable - if (!$isMobile && class_exists(\ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::class)) { + if (!$isMobile && hasPackage('package-dynamic-ui')) { $user = \Auth::user(); $homePage = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::getHomePage($user); diff --git a/ProcessMaker/Http/Middleware/GenerateMenus.php b/ProcessMaker/Http/Middleware/GenerateMenus.php index fae364d68b..a915842d42 100644 --- a/ProcessMaker/Http/Middleware/GenerateMenus.php +++ b/ProcessMaker/Http/Middleware/GenerateMenus.php @@ -21,12 +21,14 @@ public function handle(Request $request, Closure $next) Menu::make('topnav', function ($menu) { // The home will display the dynamic ui view // @todo home will replace the request and task - $menu->group(['prefix' => 'home'], function ($request_items) { - $request_items->add( - __('Home'), - ['route' => 'home', 'id' => 'home'] - )->active('home/*'); - }); + if (hasPackage('package-dynamic-ui')) { + $menu->group(['prefix' => 'home'], function ($request_items) { + $request_items->add( + __('Home'), + ['route' => 'home', 'id' => 'home'] + )->active('home/*'); + }); + } $menu->group(['prefix' => 'requests'], function ($request_items) { $request_items->add( __('Requests'), diff --git a/ProcessMaker/Jobs/RefreshArtisanCaches.php b/ProcessMaker/Jobs/RefreshArtisanCaches.php index 260c1734f1..719f3d8583 100644 --- a/ProcessMaker/Jobs/RefreshArtisanCaches.php +++ b/ProcessMaker/Jobs/RefreshArtisanCaches.php @@ -31,10 +31,10 @@ public function __construct() */ public function handle() { - Artisan::call('clear-compiled', $options = [ + $options = [ '--no-interaction' => true, '--quiet' => true, - ]); + ]; if (app()->configurationIsCached()) { Artisan::call('config:cache', $options);