diff --git a/.github/workflows/tests.yml b/.github/workflows/tests-mysql.yml similarity index 98% rename from .github/workflows/tests.yml rename to .github/workflows/tests-mysql.yml index a82946161..7c0659976 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests-mysql.yml @@ -1,4 +1,4 @@ -name: Tests +name: Tests in MySQL on: push: diff --git a/.github/workflows/tests-sqlite.yml b/.github/workflows/tests-sqlite.yml new file mode 100644 index 000000000..5b41c60de --- /dev/null +++ b/.github/workflows/tests-sqlite.yml @@ -0,0 +1,58 @@ +name: Tests in SQLite + +on: + push: + branches: + - master + - develop + pull_request: + +jobs: + tests: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php-version: + - "8.1.1" + + name: PHP ${{ matrix.php-version }} + + steps: + - uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php-version }}" + coverage: none + + - uses: actions/checkout@v4 + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Copy .env + run: | + cp -v .env.testing.example .env + cp -v .env.testing.example .env.testing + + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Generate key + run: php artisan key:generate + + - name: Directory Permissions + run: chmod -R 777 storage bootstrap/cache + + - name: Execute tests (Unit and Feature tests) via PHPUnit + env: + DB_CONNECTION: sqlite_testing + run: php artisan test --parallel diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 89d02c8b6..f5168a591 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -136,7 +136,7 @@ class AssetsController extends Controller // Search custom fields by column name foreach ($all_custom_fields as $field) { - if ($request->filled($field->db_column_name())) { + if ($request->filled($field->db_column_name()) && $field->db_column_name()) { $assets->where($field->db_column_name(), '=', $request->input($field->db_column_name())); } } diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 74abfa24b..20c52d5b2 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -597,7 +597,7 @@ function departmentNameLinkFormatter(value, row) { if ((row.assigned_user) && (row.assigned_user.department) && (row.assigned_user.department.name)) { - return '' + row.assigned_user.department.name + ''; + return '' + row.assigned_user.department.name + ''; } }