All my modules are in the web/modules/ directory except for Admin Toolbar which is in web/modules/contrib/. (Why? Long story, legacy site.) Admin Toolbar refuses to update now because of the inconsistency.
I temporarily changed the composer modules directory to web/modules/contrib/ and uninstalled the toolbar flushing the cache all along the way. I then removed the admin_toolbar directory and the composer.json entry. I changed the composer directory back to web/modules/ and installed Admin Toolbar again (doing more cache flushing). Everything's fine until I enable the module. It breaks the site and returns:
TypeError: Drupal\Core\Render\Renderer::doTrustedCallback(): Argument #1 ($callback) must be of type callable, array given, called in /var/www/html/yln/web/core/lib/Drupal/Core/Render/Renderer.php on line 788 in Drupal\Core\Render\Renderer->doTrustedCallback() (line 51 of core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php).
Is there some way to fix this? Is there something in the database that could be manually edited to get around this problem? I'm on Drupal 9.
Update: Here's my json file.
{
"name": "drupal/recommended-project",
"description": "Project template for Drupal 9 projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
"repositories": {
"0": {
"type": "composer",
"url": "https://packages.drupal.org/8"
}
},
"require": {
"composer/installers": "^1.9",
"drupal/addtocal_augment": "^1.1@beta",
"drupal/admin_toolbar": "^3.4",
"drupal/block_visibility_groups": "^2.0",
"drupal/bootstrap": "^3.28",
"drupal/bootstrap5": "^3.0",
"drupal/core-composer-scaffold": "^9.3",
"drupal/core-project-message": "^9.3",
"drupal/core-recommended": "9.5.9",
"drupal/date_augmenter": "^1.1@beta",
"drupal/devel": "^5.1",
"drupal/easy_breadcrumb": "^2.0",
"drupal/entity_print": "^2.11",
"drupal/extlink": "^1.7",
"drupal/fullcalendar_view": "^5.1",
"drupal/libraries": "^4.0",
"drupal/linkchecker": "^1.1",
"drupal/mimemail": "^1.0@alpha",
"drupal/multiple_fields_remove_button": "^2.2",
"drupal/r4032login": "^2.2",
"drupal/search_api": "^1.29",
"drupal/search_api_autocomplete": "^1.7",
"drupal/search_api_solr": "^4.2",
"drupal/search_api_spellcheck": "^4.0",
"drupal/slick": "^2.7",
"drupal/smart_date": "^4.0",
"drupal/tagclouds": "^2.0",
"drupal/twig_tweak": "^3.2",
"drupal/typed_data": "^1.0@beta",
"drupal/upgrade_status": "^4.0",
"drush/drush": "^11",
"mikehaertl/phpwkhtmltopdf": "~2.1",
"tecnickcom/tcpdf": "~6"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true
}
},
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "web/"
}
},
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library"
],
"web/modules/{$name}": [
"type:drupal-module"
],
"web/profiles/{$name}": [
"type:drupal-profile"
],
"web/themes/{$name}": [
"type:drupal-theme"
],
"drush/Commands/contrib/{$name}": [
"type:drupal-drush"
],
"web/modules/custom/{$name}": [
"type:drupal-custom-module"
],
"web/profiles/custom/{$name}": [
"type:drupal-custom-profile"
],
"web/themes/custom/{$name}": [
"type:drupal-custom-theme"
]
},
"drupal-core-project-message": {
"include-keys": [
"homepage",
"support"
],
"post-create-project-cmd-message": [
"<bg=blue;fg=white> </>",
"<bg=blue;fg=white> Congratulations, you’ve installed the Drupal codebase </>",
"<bg=blue;fg=white> from the drupal/recommended-project template! </>",
"<bg=blue;fg=white> </>",
"",
"<bg=yellow;fg=black>Next steps</>:",
" * Install the site: https://www.drupal.org/docs/8/install",
" * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
" * Get support: https://www.drupal.org/support",
" * Get involved with the Drupal community:",
" https://www.drupal.org/getting-involved",
" * Remove the plugin that prints this message:",
" composer remove drupal/core-project-message"
]
}
}
}
I just ran composer require 'drupal/admin_toolbar:^3.4'
and cleared the cache. Composer says it upgraded admin_toolbar to 3.4 but Drupal reports it's still at 3.3.
module.info.yml
somewhere during discovery to link it up. Usually you would literally move the folder, rebuild cache, then possibly rebuild cache one more time, and all should be well. BTW I realise none of this addresses the error you've got, it was more of an aside. Maybe you could restore a fresh backup, move everything into contrib, clear cache a few times, and see