Upgrade to Drupal 11.3.2. Another Unexpected error encountered
Problem with another web site after upgrading it to 11.3.2
Other upgrades applied at te same time :
mimemail
token
solo utilities
solo theme
I also have applied the patch in ThemeRegistry.php
+#3564510: TypeError: Drupal\Core\Utility\ThemeRegistry::getGlobalPreprocess(): Return value must be of type array
When I tried to run update.php I got the "unexpected error" message.
Now when I try to access to the site, I also get the "unexpected error" message.
This is what is reported in the web server logs.
[Sun Jan 11 14:31:54 2026] [X-OVHRequest-Id: 8dacd6a65072552bff3f2a8c83f6b6c0] [error] [client 2a01:cb10:873:e700:f13a:3e7a:afda:de34:0] [host www.tribupierre.net] AH10131: FastCGI: server "/homez.2186/tribupv/www/index.php" stderr: PHP message: Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\\token\\Hook\\TokenHooks::__construct(), 0 passed in /home/tribupv/www/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php on line 39 and exactly 3 expected" at /home/tribupv/www/modules/token/src/Hook/TokenHooks.php line 22
[Sun Jan 11 14:32:10 2026] [X-OVHRequest-Id: 4e9f357c081606bed8f2b04d86c9165c] [error] [client 2a01:cb10:873:e700:f13a:3e7a:afda:de34:0] [host www.tribupierre.net] AH10131: FastCGI: server "/homez.2186/tribupv/www/index.php" stderr: PHP message: Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\\token\\Hook\\TokenHooks::__construct(), 0 passed in /home/tribupv/www/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php on line 39 and exactly 3 expected" at /home/tribupv/www/modules/token/src/Hook/TokenHooks.php line 22
[Sun Jan 11 14:32:30 2026] [X-OVHRequest-Id: 16772be0668b5f8c5b710fb634d10bdd] [error] [client 2a01:cb10:873:e700:f13a:3e7a:afda:de34:0] [host www.tribupierre.net] AH10131: FastCGI: server "/homez.2186/tribupv/www/index.php" stderr: PHP message: Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\\token\\Hook\\TokenHooks::__construct(), 0 passed in /home/tribupv/www/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php on line 39 and exactly 3 expected" at /home/tribupv/www/modules/token/src/Hook/TokenHooks.php line 22
Thanks for your help.
Steps to reproduce Proposed resolution Remaining tasks User interface changes Introduced terminology API changes Data model changes Release notes snippetYou have requested a non-existent service "Drupal\\token\\Hook\\TokenHooks"
After update from 1.16 to 1.17, broke the site
Debuging the message in log server, appear a message:
Got error 'PHP message: Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: "You have requested a non-existent service "Drupal\\token\\Hook\\TokenHooks".
Drupal 10.5.7
Token 1.16
Revert the update to 1.16
Remaining tasks User interface changes API changes Data model changesDeprecated function: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead
In the `token.tokens.inc` file at line 806 (see also https://git.drupalcode.org/project/token/-/blob/8.x-1.16/token.tokens.in...) the last `case` statement in the `switch` is being terminated using a semicolon (;) instead of a colon (:). Besides the fact that this was probably a typo, terminating `case` statements with a semicolon has been deprecated in PHP 8.5.
Proposed resolutionThe semicolon in https://git.drupalcode.org/project/token/-/blob/8.x-1.16/token.tokens.in... should be replaced with a colon to ensure compatibility with PHP 8.5 and later PHP versions.
node:menu-link doesn't correctly update when "Provide a menu link" is unchecked
When a node is saved with "Provide a menu link" checked and filled in the token is generated based on the values in the form. When a node is saved outside the form it is generated based on menu_ui_get_menu_link_defaults via _token_menu_link_best_match which gets the "Best" menu link for the node.
If a menu item is removed by unchecking "Provide a menu link", token falls back to menu_ui_get_menu_link_defaults and finds the original menu link, which is removed after save leading to an incorrect token replacement.
Steps to reproduce- Set a pathauto pattern to /[node:menu-link:menu:machine-name]/[node:title]
- Save a node with "Provide a menu link" checked
- Node path should be prefixed with the menu name
- Edit the node and uncheck "Provide a menu link"
- Node path will incorrectly still be prefixed with the menu name
- Edit the node and save without changes
- Node path will be corrected to remove the menu name
Use $node->menu to filter the results from menu_ui_get_menu_link_defaults
$node->menu has the values of the form. If it was just disabled the previous id will still be there for reading, but I'm not sure if this is a documented API or undefined behavior.
Add Tugboat integration
Add Tugboat integration for live previews for every merge request.
Use template and directions at this documentation page.
To test integration:
1. Visit the "View live preview" link under the Issue Fork section.
2. Log in as admin/admin
3. Navigate to your module's configuration or other applicable page.