diff --git a/CHANGELOG.md b/CHANGELOG.md index 6725094..a904459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ minor is for. ### Breaking changes - Drupal 9 to **Drupal 11.4.5**, with the Druxt ecosystem modules on - their D11-compatible releases (druxt 1.2.1, decoupled_router 2.0.6, + their D11-compatible releases (druxt 1.2.2, decoupled_router 2.0.7, simple_oauth 6.x, jsonapi_menu_items, jsonapi_views). - The Gitpod and CircleCI configuration is gone, replaced by a dev container and GitHub Actions / GitLab CI. @@ -147,15 +147,20 @@ minor is for. ### Dependencies -- `drupal/decoupled_router` is held below 2.0.7. That release gave +- `drupal/druxt` `^1.2.2` and `drupal/decoupled_router` `^2.0`, locked at + 1.2.2 and 2.0.7. decoupled_router 2.0.7 gave `RouterPathTranslatorSubscriber::onPathTranslation()` a `: void` return - type, and druxt 1.2.1 declares its three subscribers without one, so - the container fails to rebuild: `drush cr` aborts, Drupal keeps serving - from the old container, and druxt's subscribers are silently absent. - Nothing here required decoupled_router directly, so only the lock stood - between an update and a broken site. The constraint comes off when - druxt releases a version carrying the fix - ([#3618675](https://www.drupal.org/i/3618675)). + type, and druxt 1.2.1 declared its three subscribers without one, so + the container failed to rebuild: `drush cr` aborted, Drupal kept + serving from the old container, and druxt's subscribers were silently + absent. druxt 1.2.2 carries the fix + ([#3618675](https://www.drupal.org/i/3618675)), so the hold below + 2.0.7 is gone, and `^1.2.2` rather than `^1.2` stops Composer putting + 1.2.1 next to 2.0.7 again. +- The local `ViewsPathTranslatorSubscriber` patch is dropped: both fixes + it carried shipped in druxt 1.2.2 + ([#3558380](https://www.drupal.org/i/3558380), + [#3618677](https://www.drupal.org/i/3618677)). - GitHub Actions on v7: `actions/checkout`, `actions/setup-node`, `actions/upload-artifact` and `codecov/codecov-action`. - Nuxt dependencies: core-js 3.50.0, dotenv 17, Cypress 15, diff --git a/drupal/composer.json b/drupal/composer.json index ae46004..af44b68 100644 --- a/drupal/composer.json +++ b/drupal/composer.json @@ -20,8 +20,8 @@ "drupal/core-composer-scaffold": "~11", "drupal/core-project-message": "~11", "drupal/core-recommended": "~11", - "drupal/decoupled_router": "^2.0 <2.0.7", - "drupal/druxt": "^1.2", + "drupal/decoupled_router": "^2.0", + "drupal/druxt": "^1.2.2", "drupal/simple_oauth": "^6", "drush/drush": "^13", "vlucas/phpdotenv": "^5.5" @@ -108,11 +108,6 @@ " * Remove the plugin that prints this message:", " composer remove drupal/core-project-message" ] - }, - "patches": { - "drupal/druxt": { - "Fix ViewsPathTranslatorSubscriber crash on views with no JSON:API route": "patches/druxt-views-path-translator-route-name.patch" - } } } } diff --git a/drupal/composer.lock b/drupal/composer.lock index a39c339..bf055f5 100644 --- a/drupal/composer.lock +++ b/drupal/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b3421cbdcfecc946cc0ca6023d068677", + "content-hash": "f2a797aa1313aad062d8a69fa1c20b4e", "packages": [ { "name": "asm89/stack-cors", @@ -1568,17 +1568,17 @@ }, { "name": "drupal/decoupled_router", - "version": "2.0.6", + "version": "2.0.7", "source": { "type": "git", "url": "https://git.drupalcode.org/project/decoupled_router.git", - "reference": "2.0.6" + "reference": "2.0.7" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/decoupled_router-2.0.6.zip", - "reference": "2.0.6", - "shasum": "93a725c93cac4f5c03c729c3984d926c4c52014e" + "url": "https://ftp.drupal.org/files/projects/decoupled_router-2.0.7.zip", + "reference": "2.0.7", + "shasum": "448bf05bc840b442025aea547a7c3cb0dd600fb9" }, "require": { "drupal/core": "^10.1 || ^11", @@ -1593,8 +1593,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "2.0.6", - "datestamp": "1757356868", + "version": "2.0.7", + "datestamp": "1787382329", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -1628,20 +1628,20 @@ }, { "name": "drupal/druxt", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://git.drupalcode.org/project/druxt.git", - "reference": "1.2.1" + "reference": "1.2.2" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/druxt-1.2.1.zip", - "reference": "1.2.1", - "shasum": "e12e8e22b172ac1cff11f92cd9de14a500ad927b" + "url": "https://ftp.drupal.org/files/projects/druxt-1.2.2.zip", + "reference": "1.2.2", + "shasum": "44a98ebb2e3d2471446ea609e0dfbc0c648ab99b" }, "require": { - "drupal/core": "^8.8 || ^9 || ^10 || ^11", + "drupal/core": "^10 || ^11 || ^12", "drupal/decoupled_router": "^2.0", "drupal/jsonapi_menu_items": "^1.2", "drupal/jsonapi_views": "^1.1" @@ -1649,8 +1649,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "1.2.1", - "datestamp": "1754365299", + "version": "1.2.2", + "datestamp": "1788585538", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" diff --git a/drupal/patches.lock.json b/drupal/patches.lock.json index 0066596..6aaf065 100644 --- a/drupal/patches.lock.json +++ b/drupal/patches.lock.json @@ -1,17 +1,4 @@ { - "_hash": "391b5a33d2407054254ca78e1904fad9298d7c202cdb6ae1fabe017568d593cf", - "patches": { - "drupal/druxt": [ - { - "package": "drupal/druxt", - "description": "Fix ViewsPathTranslatorSubscriber crash on views with no JSON:API route", - "url": "patches/druxt-views-path-translator-route-name.patch", - "sha256": "fd5654d5cdcea769f3be061dd0e74e9fdf03af960b929959b8d806dbad147077", - "depth": 1, - "extra": { - "provenance": "root" - } - } - ] - } + "_hash": "6142bfcb78f54dfbf5247ae5e463f25bdb8fff1890806e2e45aa81a59c211653", + "patches": [] } diff --git a/drupal/patches/druxt-views-path-translator-route-name.patch b/drupal/patches/druxt-views-path-translator-route-name.patch deleted file mode 100644 index 80b1f4b..0000000 --- a/drupal/patches/druxt-views-path-translator-route-name.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 225f6a9394ad98f80be66cf71713011fbc647c48 Mon Sep 17 00:00:00 2001 -From: Stuart Clark -Date: Fri, 14 Aug 2026 10:08:48 +0000 -Subject: [PATCH] fix: ViewsPathTranslatorSubscriber crashes on views with no - JSON:API route - -Two bugs in the same method, both only reachable when jsonapi_views is -enabled and the resolved path is a Views route with no entity - e.g. -the default "Frontpage" view on an otherwise-empty Drupal 11 site, -which is every fresh install before content exists. - -1. Url::fromRoute() takes a route name (string), not a Route object. - This one was passing $match_info[ROUTE_OBJECT] where the sibling - RouterPathTranslatorSubscriber correctly uses ROUTE_NAME a few - lines equivalent in its own file. Silently tolerated on older - Symfony/Drupal, now a hard TypeError under Drupal 11's stricter - core type-checking. - -2. jsonapi_views only registers a route for a display once JSON:API - export is explicitly enabled on it - most views, including the - default Frontpage view, don't have this. The code assumed the - route always exists once the module is enabled; it doesn't. - RouteNotFoundException now means "no JSON:API export configured - for this view," not an error. - -Found via druxt/quickstart's new .devtools/ CI, which is -the first place a fresh site:install with jsonapi_views and an -empty front page has actually been exercised end-to-end. ---- - .../ViewsPathTranslatorSubscriber.php | 21 +++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - -diff --git a/src/EventSubscriber/ViewsPathTranslatorSubscriber.php b/src/EventSubscriber/ViewsPathTranslatorSubscriber.php -index fe86f7b..975479f 100644 ---- a/src/EventSubscriber/ViewsPathTranslatorSubscriber.php -+++ b/src/EventSubscriber/ViewsPathTranslatorSubscriber.php -@@ -12,6 +12,7 @@ use Drupal\decoupled_router\PathTranslatorEvent; - use Drupal\views\Views; - use Symfony\Component\Routing\Exception\MethodNotAllowedException; - use Symfony\Component\Routing\Exception\ResourceNotFoundException; -+use Symfony\Component\Routing\Exception\RouteNotFoundException; - - /** - * Event subscriber that processes a path translation with the router info. -@@ -62,8 +63,8 @@ class ViewsPathTranslatorSubscriber extends RouterPathTranslatorSubscriber { - $executable = Views::executableFactory()->get($view); - $executable->setDisplay($match_info['display_id']); - -- $route = $match_info[RouteObjectInterface::ROUTE_OBJECT]; -- $resolved_url = Url::fromRoute($route, [], ['absolute' => TRUE])->toString(TRUE); -+ $route_name = $match_info[RouteObjectInterface::ROUTE_NAME]; -+ $resolved_url = Url::fromRoute($route_name, [], ['absolute' => TRUE])->toString(TRUE); - $response->addCacheableDependency($resolved_url); - - $is_home_path = $this->resolvedPathIsHomePath($resolved_url->getGeneratedUrl()); -@@ -127,10 +128,18 @@ class ViewsPathTranslatorSubscriber extends RouterPathTranslatorSubscriber { - $match_info['display_id'], - ]; - $jsonapi_views_route = implode('.', $parts); -- $resolved_jsonapi_views_url = Url::fromRoute($jsonapi_views_route, [], ['absolute' => TRUE])->toString(TRUE); -- $response->addCacheableDependency($resolved_jsonapi_views_url); -- -- $output['jsonapi_views'] = $resolved_jsonapi_views_url->getGeneratedUrl(); -+ // jsonapi_views only exposes a route for a display once JSON:API -+ // export has been enabled on it - most views (e.g. the default -+ // "Frontpage" view) don't have this, so a missing route is expected, -+ // not an error. -+ try { -+ $resolved_jsonapi_views_url = Url::fromRoute($jsonapi_views_route, [], ['absolute' => TRUE])->toString(TRUE); -+ $response->addCacheableDependency($resolved_jsonapi_views_url); -+ -+ $output['jsonapi_views'] = $resolved_jsonapi_views_url->getGeneratedUrl(); -+ } -+ catch (RouteNotFoundException $e) { -+ } - } - - $response->addCacheableDependency($view); --- -2.55.0 -