diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a6e644bf..1afab033 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -7,13 +7,35 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout Code + id: checkout + uses: actions/checkout@v3 + + - name: Extract PHP Version + id: php + uses: docker://ghcr.io/un-ocha/actions:extract-php-version-main + with: + docker_file: 'docker/Dockerfile' + docker_image: 'public.ecr.aws/unocha/php-k8s' + - name: Setup PHP with PECL extension uses: shivammathur/setup-php@v2 + if: ${{ !env.ACT }} + with: + php-version: ${{ steps.php.outputs.php_version }} + tools: composer + env: + fail-fast: true + + - name: Setup PHP with PECL extension locally + uses: shivammathur/setup-php@v2 + if: ${{ env.ACT }} with: - php-version: 8.0 + php-version: ${{ steps.php.outputs.php_version }} tools: composer env: fail-fast: true + runner: self-hosted - name: Software versions id: versions @@ -22,10 +44,6 @@ jobs: run: | php --version && composer --version - - name: Checkout Code - id: checkout - uses: actions/checkout@v3 - - name: Composer Validate id: validate uses: cafuego/command-output@main @@ -47,7 +65,8 @@ jobs: - name: Configure AWS Credentials id: aws - uses: aws-actions/configure-aws-credentials@v1-node16 + if: ${{ !env.ACT }} + uses: aws-actions/configure-aws-credentials@v2 with: aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} @@ -55,6 +74,7 @@ jobs: - name: Login to Public ECR id: aws-login + if: ${{ !env.ACT }} uses: docker/login-action@v2.1.0 with: registry: public.ecr.aws @@ -147,6 +167,7 @@ jobs: - name: Find Comment uses: peter-evans/find-comment@v2 id: fc + if: ${{ !env.ACT }} with: github: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} @@ -155,6 +176,7 @@ jobs: - name: Create or update comment uses: peter-evans/create-or-update-comment@v2 + if: ${{ !env.ACT }} with: github: ${{ secrets.GITHUB_TOKEN }} comment-id: ${{ steps.fc.outputs.comment-id }} @@ -184,7 +206,7 @@ jobs: - name: Slack Success Notification id: slack_success - if: success() + if: ${{ !env.ACT && success() }} uses: slackapi/slack-github-action@v1.23.0 with: channel-id: '${{ secrets.SLACK_CHANNEL }}' @@ -211,7 +233,7 @@ jobs: - name: Slack Failure Notification id: slack_failure - if: failure() + if: ${{ !env.ACT && failure() }} uses: slackapi/slack-github-action@v1.23.0 with: channel-id: '${{ secrets.SLACK_CHANNEL }}' @@ -235,3 +257,13 @@ jobs: } env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + - name: Clean up + id: docker-clean-up + if: ${{ env.ACT }} + uses: cafuego/command-output@main + with: + run: | + docker compose -f tests/docker-compose.yml down + env: + fail-fast: true diff --git a/composer.lock b/composer.lock index c6ab7730..0f852d23 100644 --- a/composer.lock +++ b/composer.lock @@ -302,16 +302,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.5", + "version": "1.3.6", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" + "reference": "90d087e988ff194065333d16bc5cf649872d9cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/90d087e988ff194065333d16bc5cf649872d9cdb", + "reference": "90d087e988ff194065333d16bc5cf649872d9cdb", "shasum": "" }, "require": { @@ -358,7 +358,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.5" + "source": "https://github.com/composer/ca-bundle/tree/1.3.6" }, "funding": [ { @@ -374,7 +374,7 @@ "type": "tidelift" } ], - "time": "2023-01-11T08:27:00+00:00" + "time": "2023-06-06T12:02:59+00:00" }, { "name": "composer/composer", @@ -995,25 +995,25 @@ }, { "name": "consolidation/annotated-command", - "version": "4.8.2", + "version": "4.9.1", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "7f5dd1aafb93a10593ed70f3caa6a0cd5a32f0e3" + "reference": "e01152f698eff4cb5df3ebfe5e097ef335dbd3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7f5dd1aafb93a10593ed70f3caa6a0cd5a32f0e3", - "reference": "7f5dd1aafb93a10593ed70f3caa6a0cd5a32f0e3", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/e01152f698eff4cb5df3ebfe5e097ef335dbd3c9", + "reference": "e01152f698eff4cb5df3ebfe5e097ef335dbd3c9", "shasum": "" }, "require": { - "consolidation/output-formatters": "^4.1.1", + "consolidation/output-formatters": "^4.3.1", "php": ">=7.1.3", - "psr/log": "^1|^2|^3", - "symfony/console": "^4.4.8|^5|^6", - "symfony/event-dispatcher": "^4.4.8|^5|^6", - "symfony/finder": "^4.4.8|^5|^6" + "psr/log": "^1 || ^2 || ^3", + "symfony/console": "^4.4.8 || ^5 || ^6", + "symfony/event-dispatcher": "^4.4.8 || ^5 || ^6", + "symfony/finder": "^4.4.8 || ^5 || ^6" }, "require-dev": { "composer-runtime-api": "^2.0", @@ -1045,9 +1045,9 @@ "description": "Initialize Symfony Console commands from annotated command class methods.", "support": { "issues": "https://github.com/consolidation/annotated-command/issues", - "source": "https://github.com/consolidation/annotated-command/tree/4.8.2" + "source": "https://github.com/consolidation/annotated-command/tree/4.9.1" }, - "time": "2023-03-11T19:32:28+00:00" + "time": "2023-05-20T04:19:01+00:00" }, { "name": "consolidation/config", @@ -1258,16 +1258,16 @@ }, { "name": "consolidation/output-formatters", - "version": "4.2.4", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "b377db7e9435c50c4e019c26ec164b547e754ca0" + "reference": "f65524e9ecd2bd0021c4b18710005caaa6dcbd86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/b377db7e9435c50c4e019c26ec164b547e754ca0", - "reference": "b377db7e9435c50c4e019c26ec164b547e754ca0", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/f65524e9ecd2bd0021c4b18710005caaa6dcbd86", + "reference": "f65524e9ecd2bd0021c4b18710005caaa6dcbd86", "shasum": "" }, "require": { @@ -1306,9 +1306,9 @@ "description": "Format text by applying transformations provided by plug-in formatters.", "support": { "issues": "https://github.com/consolidation/output-formatters/issues", - "source": "https://github.com/consolidation/output-formatters/tree/4.2.4" + "source": "https://github.com/consolidation/output-formatters/tree/4.3.1" }, - "time": "2023-02-24T03:39:10+00:00" + "time": "2023-05-20T03:23:06+00:00" }, { "name": "consolidation/robo", @@ -1846,25 +1846,29 @@ }, { "name": "doctrine/deprecations", - "version": "v1.0.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -1883,9 +1887,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, - "time": "2022-05-02T15:47:09+00:00" + "time": "2023-06-03T09:27:29+00:00" }, { "name": "doctrine/instantiator", @@ -2302,17 +2306,17 @@ }, { "name": "drupal/admin_toolbar", - "version": "3.4.0", + "version": "3.4.1", "source": { "type": "git", "url": "https://git.drupalcode.org/project/admin_toolbar.git", - "reference": "3.4.0" + "reference": "3.4.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/admin_toolbar-3.4.0.zip", - "reference": "3.4.0", - "shasum": "2dc9bf50350693827b446180c9d61feebacc4b7a" + "url": "https://ftp.drupal.org/files/projects/admin_toolbar-3.4.1.zip", + "reference": "3.4.1", + "shasum": "bcb15ab40016becdb3ac8f21d7d1a721f48f3577" }, "require": { "drupal/core": "^9.2 || ^10" @@ -2323,8 +2327,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "3.4.0", - "datestamp": "1683730547", + "version": "3.4.1", + "datestamp": "1684944156", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -4660,27 +4664,27 @@ }, { "name": "drupal/features", - "version": "3.12.0", + "version": "3.13.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/features.git", - "reference": "8.x-3.12" + "reference": "8.x-3.13" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/features-8.x-3.12.zip", - "reference": "8.x-3.12", - "shasum": "f28d6e7d3340e32666a3e8ae515ed746dbe86b98" + "url": "https://ftp.drupal.org/files/projects/features-8.x-3.13.zip", + "reference": "8.x-3.13", + "shasum": "d722769994ae9277fa99bba3abc2a891011055db" }, "require": { - "drupal/config_update": "^1.4", - "drupal/core": "^8.8 || ^9" + "drupal/config_update": "^1.4 || ^2", + "drupal/core": "^9.4 || ^10" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-3.12", - "datestamp": "1612830531", + "version": "8.x-3.13", + "datestamp": "1686073886", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -4688,7 +4692,7 @@ }, "drush": { "services": { - "drush.services.yml": "^9 || ^10" + "drush.services.yml": "^10 || ^11" } } }, @@ -4697,6 +4701,10 @@ "GPL-2.0-or-later" ], "authors": [ + { + "name": "Dave Reid", + "homepage": "https://www.drupal.org/user/53892" + }, { "name": "dawehner", "homepage": "https://www.drupal.org/user/99340" @@ -4725,6 +4733,10 @@ "name": "joseph.olstad", "homepage": "https://www.drupal.org/user/1321830" }, + { + "name": "matthand", + "homepage": "https://www.drupal.org/user/171527" + }, { "name": "mpotter", "homepage": "https://www.drupal.org/user/616192" @@ -5901,17 +5913,17 @@ }, { "name": "drupal/metatag", - "version": "1.23.0", + "version": "1.25.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/metatag.git", - "reference": "8.x-1.23" + "reference": "8.x-1.25" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/metatag-8.x-1.23.zip", - "reference": "8.x-1.23", - "shasum": "d0e53e4f41c759ea8ca4c504fc6fee9a5184a701" + "url": "https://ftp.drupal.org/files/projects/metatag-8.x-1.25.zip", + "reference": "8.x-1.25", + "shasum": "8603d84df3b93dd02dae601d57a6347598829e56" }, "require": { "drupal/core": "^9.3 || ^10", @@ -5922,7 +5934,7 @@ "drupal/hal": "^9 || ^1 || ^2", "drupal/metatag_dc": "*", "drupal/metatag_open_graph": "*", - "drupal/page_manager": "^4.0", + "drupal/page_manager": "*", "drupal/panelizer": "^4.0", "drupal/redirect": "^1.0", "drupal/webprofiler": "^9 || ^10", @@ -5931,8 +5943,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.23", - "datestamp": "1683903480", + "version": "8.x-1.25", + "datestamp": "1685541226", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -8143,16 +8155,16 @@ }, { "name": "egulias/email-validator", - "version": "3.2.5", + "version": "3.2.6", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "b531a2311709443320c786feb4519cfaf94af796" + "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/b531a2311709443320c786feb4519cfaf94af796", - "reference": "b531a2311709443320c786feb4519cfaf94af796", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7", + "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7", "shasum": "" }, "require": { @@ -8198,7 +8210,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/3.2.5" + "source": "https://github.com/egulias/EmailValidator/tree/3.2.6" }, "funding": [ { @@ -8206,7 +8218,7 @@ "type": "github" } ], - "time": "2023-01-02T17:26:14+00:00" + "time": "2023-06-01T07:04:22+00:00" }, { "name": "enlightn/security-checker", @@ -8677,16 +8689,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.5.2", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "b94b2807d85443f9719887892882d0329d1e2598" + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", - "reference": "b94b2807d85443f9719887892882d0329d1e2598", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", "shasum": "" }, "require": { @@ -8696,11 +8708,6 @@ "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, "autoload": { "files": [ "src/functions_include.php" @@ -8741,7 +8748,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.2" + "source": "https://github.com/guzzle/promises/tree/1.5.3" }, "funding": [ { @@ -8757,7 +8764,7 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:55:35+00:00" + "time": "2023-05-21T12:31:43+00:00" }, { "name": "guzzlehttp/psr7", @@ -9696,16 +9703,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.15.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", "shasum": "" }, "require": { @@ -9746,9 +9753,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2023-05-19T20:20:00+00:00" }, { "name": "oomphinc/composer-installers-extender", @@ -10318,16 +10325,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714" + "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", + "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", "shasum": "" }, "require": { @@ -10370,9 +10377,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.2" }, - "time": "2023-03-27T19:02:04+00:00" + "time": "2023-05-30T18:13:47+00:00" }, { "name": "phpspec/prophecy", @@ -15671,16 +15678,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.23", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "9a8a5b6d6508928174ded2109e29328a55342a42" + "reference": "8e12706bf9c68a2da633f23bfdc15b4dce5970b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9a8a5b6d6508928174ded2109e29328a55342a42", - "reference": "9a8a5b6d6508928174ded2109e29328a55342a42", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/8e12706bf9c68a2da633f23bfdc15b4dce5970b3", + "reference": "8e12706bf9c68a2da633f23bfdc15b4dce5970b3", "shasum": "" }, "require": { @@ -15689,7 +15696,6 @@ "symfony/polyfill-php80": "^1.16" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<4.4" }, "require-dev": { @@ -15740,7 +15746,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.23" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.24" }, "funding": [ { @@ -15756,7 +15762,7 @@ "type": "tidelift" } ], - "time": "2023-04-18T09:26:27+00:00" + "time": "2023-05-25T13:05:00+00:00" }, { "name": "symfony/yaml", @@ -17174,17 +17180,17 @@ }, { "name": "drupal/devel", - "version": "5.1.1", + "version": "5.1.2", "source": { "type": "git", "url": "https://git.drupalcode.org/project/devel.git", - "reference": "5.1.1" + "reference": "5.1.2" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/devel-5.1.1.zip", - "reference": "5.1.1", - "shasum": "d7423dfe9c2333508618975c37f3b63026adca50" + "url": "https://ftp.drupal.org/files/projects/devel-5.1.2.zip", + "reference": "5.1.2", + "shasum": "9b35e38bf2043bf87f88585b3d9100f38da8f07f" }, "require": { "doctrine/common": "^2.7 || ^3.4", @@ -17204,8 +17210,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "5.1.1", - "datestamp": "1671644739", + "version": "5.1.2", + "datestamp": "1686161028", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" diff --git a/html/modules/custom/gms_pdflink/src/Controller/PrintSectionController.php b/html/modules/custom/gms_pdflink/src/Controller/PrintSectionController.php index bc8de005..c7967c27 100644 --- a/html/modules/custom/gms_pdflink/src/Controller/PrintSectionController.php +++ b/html/modules/custom/gms_pdflink/src/Controller/PrintSectionController.php @@ -10,7 +10,6 @@ use Drupal\Core\Render\RendererInterface; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RequestStack; use Drupal\Component\Utility\Html; use Symfony\Component\HttpFoundation\Response; @@ -127,7 +126,7 @@ public function viewPrint($export_type, $entity_type, $entity_id) { $pdf = ocha_snap($url, $params); if (empty($pdf)) { $this->messenger()->addMessage($this->t('Failed to generate a PDF file.'), 'error'); - $response = new RedirectResponse($url, 301); + $response = new Response($this->t('Failed to generate a PDF file.'), 503); $response->send(); } else { @@ -143,9 +142,8 @@ public function viewPrint($export_type, $entity_type, $entity_id) { } } else { - global $base_url; $this->messenger()->addMessage($this->t('Access denied.'), 'error'); - $response = new RedirectResponse($base_url, 301); + $response = new Response($this->t('Access denied.'), 403); $response->send(); } @@ -213,9 +211,8 @@ public function downloadPdf($entity_type, $entity_id) { die; } else { - global $base_url; $this->messenger()->addMessage($this->t('Access denied.'), 'error'); - $response = new RedirectResponse($base_url, 301); + $response = new Response($this->t('Access denied.'), 403); $response->send(); } } diff --git a/html/modules/custom/gms_pdflink/src/Controller/ViewPdfController.php b/html/modules/custom/gms_pdflink/src/Controller/ViewPdfController.php index d66e94a1..7278ac8b 100644 --- a/html/modules/custom/gms_pdflink/src/Controller/ViewPdfController.php +++ b/html/modules/custom/gms_pdflink/src/Controller/ViewPdfController.php @@ -10,7 +10,6 @@ use Drupal\Component\Utility\Html; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RequestStack; /** @@ -122,7 +121,7 @@ public function viewPrint($export_type, $entity_type, $entity_id) { $pdf = ocha_snap($url, $params); if (empty($pdf)) { $this->messenger()->addMessage($this->t('Failed to generate a PDF file.'), 'error'); - $response = new RedirectResponse($url, 301); + $response = new Response($this->t('Failed to generate a PDF file.'), 503); $response->send(); } else { @@ -138,9 +137,8 @@ public function viewPrint($export_type, $entity_type, $entity_id) { } } else { - global $base_url; $this->messenger()->addMessage($this->t('Access denied.'), 'error'); - $response = new RedirectResponse($base_url, 301); + $response = new Response($this->t('Access denied.'), 403); $response->send(); } } diff --git a/html/themes/custom/gms_ocha_common/gms_ocha_common.theme b/html/themes/custom/gms_ocha_common/gms_ocha_common.theme index f094723a..78263f75 100644 --- a/html/themes/custom/gms_ocha_common/gms_ocha_common.theme +++ b/html/themes/custom/gms_ocha_common/gms_ocha_common.theme @@ -305,6 +305,11 @@ function gms_ocha_common_form_alter(&$form, &$form_state, $form_id) { }; } } + if (in_array($form['#form_id'], ['search_block_form'])) { + $form['search_api_fulltext'] = $form['keys']; + unset($form['keys']); + $form['#action'] = '/searchpage'; + } } /**