- Issue created by @project update bot
- last update
about 1 year ago 1 pass This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 11 Compatibility
According to the Upgrade Status module → , even with these changes, this module is not yet compatible with Drupal 11.
Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.
Therefore these changes did not update the
info.yml
file for Drupal 11 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot → to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug info
Bot run #11-121090This patch was created using these packages:
- drupal/upgrade_status: 4.1.0
- mglaman/phpstan-drupal: 1.2.7
- palantirnet/drupal-rector: 0.20.1
- last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass This comment was forced and has ignored the check if a change was already posted. This is only done when we want to update the issue without waiting for changes to happen.
This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 11 Compatibility
According to the Upgrade Status module → , even with these changes, this module is not yet compatible with Drupal 11.
Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.
Therefore, these changes did not update the
info.yml
file for Drupal 11 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot → to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug information
Bot run #11-137198These packages were used to generate the fixes:
- drupal/upgrade_status: 4.1.0
- mglaman/phpstan-drupal: 1.2.10
- palantirnet/drupal-rector: 0.20.1
- last update
about 1 year ago 1 pass - First commit to issue fork.
- 🇸🇰Slovakia poker10
I have created a new MR !9, where I have put together a fix from the project update bot, 🐛 user_roles() is Deprecated Needs review and updated the .info file to support D11.
- First commit to issue fork.
- 🇮🇳India manishvaity
manishvaity → changed the visibility of the branch 3431537-d11_ready to hidden.
- 🇮🇳India sheshsharma
sheshsharma → changed the visibility of the branch 3431537-d11_ready to active.
- 🇮🇳India sheshsharma
I am getting below error in Drupal 11 so fixing in MR10 -
Error 1:
TypeError: Drupal\lang_dropdown\Plugin\Block\LanguageDropdownBlock::__construct(): Argument #7 ($library_discovery) must be of type Drupal\Core\Asset\LibraryDiscovery, Drupal\Core\Asset\LibraryDiscoveryCollector given, called in /app/web/modules/contrib/lang_dropdown-3431537/src/Plugin/Block/LanguageDropdownBlock.php on line 113 in Drupal\lang_dropdown\Plugin\Block\LanguageDropdownBlock->__construct() (line 99 of /app/web/modules/contrib/lang_dropdown-3431537/src/Plugin/Block/LanguageDropdownBlock.php).
Error 2:
Error: Call to undefined function Drupal\lang_dropdown\Plugin\Block\user_roles() in Drupal\lang_dropdown\Plugin\Block\LanguageDropdownBlock->blockForm() (line 557 of /app/web/modules/contrib/lang_dropdown-3431537/src/Plugin/Block/LanguageDropdownBlock.php). - 🇮🇳India sheshsharma
MR!10 Makes this module compatible with Drupal 11. Functionality is working as expected.
RTBC +1 MR!10 Makes this module compatible with Drupal 11. Functionality is working as expected.
RTBC +1- 🇮🇳India sheshsharma
Hi Dmitry Kiselev,
Module is compatible with Drupal l11 and working as expected also pipeline is pass. Can you please check again.
- 🇧🇷Brazil carolpettirossi Campinas - SP
I'm still getting errors on a existing site on version 2.2.0
TypeError: Drupal\lang_dropdown\Plugin\Block\LanguageDropdownBlock::__construct(): Argument #7 ($library_discovery_collector) must be of type Drupal\Core\Asset\LibraryDiscoveryCollector, Drupal\Core\Asset\LibraryDiscovery given, called in /var/www/web/modules/contrib/lang_dropdown/src/Plugin/Block/LanguageDropdownBlock.php on line 115 in Drupal\lang_dropdown\Plugin\Block\LanguageDropdownBlock->__construct() (line 101 of modules/contrib/lang_dropdown/src/Plugin/Block/LanguageDropdownBlock.php).
- 🇧🇷Brazil carolpettirossi Campinas - SP
This is the library.discovery on D11:
library.discovery: class: Drupal\Core\Asset\LibraryDiscoveryCollector arguments: ['@cache.discovery', '@lock', '@library.discovery.parser', '@theme.manager'] tags: - { name: needs_destruction }
This is the library.discovery on D10.4:
library.discovery: class: Drupal\Core\Asset\LibraryDiscovery arguments: ['@library.discovery.collector'] Drupal\Core\Asset\LibraryDiscoveryInterface: '@library.discovery' library.discovery.collector: class: Drupal\Core\Asset\LibraryDiscoveryCollector arguments: ['@cache.discovery', '@lock', '@library.discovery.parser', '@theme.manager'] tags: - { name: needs_destruction }
- 🇳🇿New Zealand murrow
Me too! I am seeing this on D10.4.1. LanguageDropdownBlock needs to have its create method updated to include library.discovery.collector:
/** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $configuration, $plugin_id, $plugin_definition, $container->get('language_manager'), $container->get('path.matcher'), $container->get('module_handler'), $container->get('library.discovery.collector'), $container->get('current_user'), $container->get('form_builder') ); }
- 🇩🇪Germany heliogabal Berlin
I can confirm that adding the
library.discovery.collector
as done in the patch fixes the issue for me. - 🇪🇸Spain jlbellido
Hello,
I think we are having a new error after 🐛 Uncaught PHP Exception Active was addressed. I'm getting now:
Error: Call to undefined method Drupal\Core\Asset\LibraryDiscoveryCollector::getLibraryByName() en Drupal\lang_dropdown\Plugin\Block\LanguageDropdownBlock->blockForm() (linea 257 de /var/www/html/web/modules/contrib/lang_dropdown/src/Plugin/Block/LanguageDropdownBlock.php).
When I try to add the block to a region.
The root issue is we need to use Drupal\Core\Asset\LibraryDiscovery instead and change all the references from Drupal\Core\Asset\LibraryDiscoveryCollector to Drupal\Core\Asset\LibraryDiscovery in the class. By doing it, it solves all issues and it goes back to normal.
I'm sending a new MR at 🐛 Uncaught PHP Exception Active
- 🇪🇸Spain jlbellido
Well, I better create a new issue to not open 🐛 Uncaught PHP Exception Active again.
Thanks