Skip to content

Commit af0e9d3

Browse files
authored
Merge pull request #2372 from Blair2004/v5.0.x
V5.0.x
2 parents 57ef8dc + 8d5baca commit af0e9d3

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ master ]
88
jobs:
99
laravel-tests:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-node@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ public/hot
5252
.phpunit.cache/test-results
5353
storage/dotenv-editor
5454
.cloud
55+
ns

app/Services/ModulesService.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace App\Services;
44

5-
use App\Classes\Cache;
65
use App\Classes\XMLParser;
76
use App\Events\ModulesAfterDisabledEvent;
87
use App\Events\ModulesAfterEnabledEvent;
@@ -23,6 +22,7 @@
2322
use Illuminate\Support\Arr;
2423
use Illuminate\Support\Collection;
2524
use Illuminate\Support\Facades\Artisan;
25+
use Illuminate\Support\Facades\Cache;
2626
use Illuminate\Support\Facades\Log;
2727
use Illuminate\Support\Facades\Storage;
2828
use Illuminate\Support\Facades\View;
@@ -206,6 +206,7 @@ public function __init( string $dir ): void
206206
*/
207207
if ( Helper::installed() ) {
208208
$modules = $this->options->get( 'enabled_modules', [] );
209+
$modules = collect( array_merge( $modules, $this->autoloadedNamespace ) )->unique()->toArray();
209210
$config[ 'enabled' ] = in_array( $config[ 'namespace' ], (array) $modules ) ? true : false;
210211
}
211212

@@ -1228,6 +1229,7 @@ public function enable( string $namespace ): array|JsonResponse
12281229
* enabled.
12291230
*/
12301231
$enabledModules = $this->options->get( 'enabled_modules', [] );
1232+
$enabledModules = collect( array_merge( $enabledModules, $this->autoloadedNamespace ) )->unique()->toArray();
12311233

12321234
ModulesBeforeEnabledEvent::dispatch( $module );
12331235

@@ -1347,7 +1349,7 @@ public function disable( string $namespace ): array
13471349
{
13481350
$this->checkManagementStatus();
13491351

1350-
// check if module exists
1352+
// check if the module exists
13511353
if ( $module = $this->get( $namespace ) ) {
13521354
if ( $module[ 'autoloaded' ] ) {
13531355
throw new NotAllowedException( sprintf( __( 'The module "%s" is autoloaded and cannot be disabled.' ), $module[ 'name' ] ) );

config/nexopos.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* This is the core version of NexoPOS. This is used to displays on the
1010
* dashboard and to ensure a compatibility with the modules.
1111
*/
12-
'version' => '5.3.9',
12+
'version' => '5.3.10',
1313

1414
/**
1515
* --------------------------------------------------------------------

tests/Traits/WithProductTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ protected function attemptChangeProductCategory()
160160
$newCategoryRefreshed = $newCategory->fresh();
161161

162162
$this->assertGreaterThan(
163-
minimum: $newCategory->total_items,
163+
expected: $newCategory->total_items,
164164
actual: $newCategoryRefreshed->total_items,
165165
message: sprintf(
166166
'The new category "total_items" has\nt properly been updated. %s was expected, we have %s currently defined.',
@@ -170,7 +170,7 @@ protected function attemptChangeProductCategory()
170170
);
171171

172172
$this->assertGreaterThan(
173-
minimum: $oldCategoryRefreshed->total_items,
173+
expected: $oldCategoryRefreshed->total_items,
174174
actual: $oldCategory->total_items,
175175
message: sprintf(
176176
'The old category "total_items" has\nt properly been updated. %s was expected, we have %s currently defined.',

0 commit comments

Comments
 (0)