Problem/Motivation
Drupal 11.4.0 became available on 2026-07-01.
In Drupal 11.4.0, the node search functionality was moved to a sub-module (see change record 3590298: Node search plugin node_search moved to sub-module Search Node in Search). As part of this, \Drupal\node\Plugin\Search\NodeSearch moved to \Drupal\search_node\Plugin\Search\NodeSearch. Also, the signature of the indexStatus() function changed...
-public function indexStatus()
+public function indexStatus(): array
In trash-3.0.28, trash-3.x-dev, and trash-3.1.x-dev, there is a stub function \Drupal\trash\Plugin\Search\TrashNodeSearch::indexStatus(). Its indexStatus() function override has the signature...
public function indexStatus(): mixed
... and I guess PHP 8.3.30 (i.e.: what my local machine is testing on) doesn't consider mixed and array to be compatible.
Steps to reproduce
- Set up a site using Drupal core version 11.3.13
- Install trash-3.0.28, trash-3.x-dev, or trash-3.1.x-dev
- Upgrade the site to drupal-11.4.0
-
Run database updates
Expected behavior: the site upgrades with no errors
Actual behavior: during system_update_11401 you see the following error message:> PHP Fatal error: Declaration of Drupal\trash\Plugin\Search\TrashNodeSearch::indexStatus(): mixed must be compatible with Drupal\search_node\Plugin\Search\SearchNode::indexStatus(): array in /var/www/html/web/modules/contrib/trash/src/Plugin/Search/TrashNodeSearch.php on line 47 > [error] RuntimeException: Recursive router rebuild detected. in Drupal\Core\Routing\RouteBuilder->rebuild() (line 114 of /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php) #0 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(160): Drupal\Core\Routing\RouteBuilder->rebuild() > #1 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(172): Drupal\Core\Routing\RouteBuilder->rebuildIfNeeded() > #2 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(729): Drupal\Core\Routing\RouteBuilder->destruct() > #3 /var/www/html/vendor/drush/drush/src/Boot/DrupalBoot8.php(320): Drupal\Core\DrupalKernel->terminate() > #4 [internal function]: Drush\Boot\DrupalBoot8->terminate() > #5 {main}. > RuntimeException: Recursive router rebuild detected. in /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php on line 114 #0 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(160): Drupal\Core\Routing\RouteBuilder->rebuild() > #1 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(172): Drupal\Core\Routing\RouteBuilder->rebuildIfNeeded() > #2 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(729): Drupal\Core\Routing\RouteBuilder->destruct() > #3 /var/www/html/vendor/drush/drush/src/Boot/DrupalBoot8.php(320): Drupal\Core\DrupalKernel->terminate() > #4 [internal function]: Drush\Boot\DrupalBoot8->terminate() > #5 {main} In ProcessBase.php line 171: Unable to decode output into JSON: Syntax error Fatal error: Declaration of Drupal\trash\Plugin\Search\TrashNodeSearch::indexStatus(): mixed must be compatible with Drupal\search_node\Plugin\Search\SearchNode::indexStatus(): array in /var/www/html/web/modules/contrib/trash/src/Plugin/Search/TrashNodeSearch.php on line 47 RuntimeException: Recursive router rebuild detected. in Drupal\Core\Routing\RouteBuilder->rebuild() (line 114 of /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php).
Proposed resolution
Lets try changing the signature to match 11.4.0's public function indexStatus(): array. It seems like a return type is undeclared in 10.3.x, 10.4.x, 10.5.x, 10.6.x, 11.0.x, 11.1.x, 11.2.x, and 11.3.x.
Remaining tasks
Determine if a return type of :array is compatible with core ^10.3 | ^11- @mparker17 thinks it should beCreate a merge request- merge request !135 created by @mparker17 in #3 for 3.1.x branchCommunity review- done by @mark_fullmer in #7Maintainer review- done by @amateescu before #8Commit to 3.1.x- done by @amateescu in #8Commit to 3.x- done by @amateescu in #9Release- released in trash-3.0.29
User interface changes
None.
API changes
The signature of Drupal\trash\Plugin\Search\TrashNodeSearch::indexStatus(): mixed changes to Drupal\trash\Plugin\Search\TrashNodeSearch::indexStatus(): array.
Data model changes
None.
Issue fork trash-3607782
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mparker17Lets try patching 3.1.x first... sorry for the noise.
Comment #4
mparker17Apparently removing the return-type declaration also made PHP 8.3 unhappy; lets try
: arrayinstead.Comment #5
mparker17Taking a look at whether a return type of
:arrayis compatible with the versions of Drupal core that Trash supports (i.e.: ^10.3 | ^11)...... so I feel confident taking the merge request out of draft status, and changing the issue status to Needs review.
@amateescu, let me know if you'd like a separate merge request for 3.x branch!
Comment #6
mparker17(Fix unfinished sentence in issue summary)
Comment #7
mark_fullmerConfirmed that this resolves the compatibility issue when using Drupal 11.4.0 and having the Search module installed. Marking as RTBC!
Comment #10
amateescu commentedMerged into 3.1.x and cherry-picked to 3.x, thanks!
Also released 3.0.29 so it's easier for everyone to upgrade to 11.4.0 :)
Comment #12
mparker17Yay, thanks everyone!
Comment #13
mparker17Updating the issue summary for record-keeping purposes. Thanks for your patience with the noise!
Comment #14
mparker17(One more update, sorry)