- Issue created by @Rajab Natshah
- @rajab-natshah opened merge request.
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 8:08pm 15 March 2023 - Status changed to Needs work
almost 2 years ago 8:13pm 15 March 2023 The last submitted patch, 4: 3348277-4.patch, failed testing. View results →
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- 🇯🇴Jordan Rajab Natshah Jordan
Having issues with
Hide if only one language is availableIf only a single language is available, go ahead and hide the block
- 🇯🇴Jordan Rajab Natshah Jordan
Maybe related to changes after the fix for
Drupal core - Moderately critical - Information disclosure - SA-CORE-2023-003 →The language module provides a Language switcher block which can be placed to provide links to quickly switch between different languages.
The URL of unpublished translations may be disclosed. When used in conjunction with a module like Pathauto, this may reveal the title of unpublished content.The block will not show up in many pages.
- 🇯🇴Jordan Rajab Natshah Jordan
In Drupal core Language Block
$links = $this->languageManager->getLanguageSwitchLinks($type, Url::fromRouteMatch(\Drupal::routeMatch()));
https://git.drupalcode.org/project/drupal/-/commit/18bce0cd518975407921b...
- Status changed to Needs review
almost 2 years ago 9:28pm 15 March 2023 - 🇯🇴Jordan Rajab Natshah Jordan
Attached a patch fix for the
8.x-2.0
released tag - Status changed to Needs work
almost 2 years ago 5:32am 16 March 2023 - 🇮🇳India prashant.c Dharamshala
Patch fails to apply on
Drupal 9.5
and module version8.x-2.x
error: patch failed: src/Plugin/Block/LanguageDropdownBlock.php:714
- 🇮🇳India prashant.c Dharamshala
I personally experienced this error with only logged-in users. The root cause is the change record mentioned at https://www.drupal.org/node/3247792 → . To resolve this issue, one possible solution is to cast the
<?php array_keys((array)$languages->links) ?>
to an array. - Status changed to Needs review
almost 2 years ago 8:10am 16 March 2023 - 🇯🇴Jordan Rajab Natshah Jordan
-
Rajab Natshah →
committed de9c1d1d on 8.x-2.x
Issue #3348277: Fix TypeError: array_keys(): Argument #1 ($array) must...
-
Rajab Natshah →
committed de9c1d1d on 8.x-2.x
- Status changed to Fixed
almost 2 years ago 8:34am 16 March 2023 - 🇪🇸Spain menu2crak
Hello, after applying patch 16, I solved the error "TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in Language Drop down Block class" the problem that now gives me another error new. The error occurs because you are trying to count a null variable. Line 239 web/modules/contrib/dropdown_language/src/Plugin/Block/DropdownLanguage.php
Do I have to make a new patch?
Greetings and thank you
- 🇮🇳India prashant.c Dharamshala
@menu2crak
No, you do not have to make a new patch. The patch is already there and committed. Regarding contributing to Drupal you can go through the documents
https://www.drupal.org/community/contributor-guide/contribution-areas →
https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa... → Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
almost 2 years ago 11:12pm 17 April 2023 - 🇬🇧United Kingdom londova
Is there any plan to issue a new module version with this patch included?
- 🇨🇴Colombia carma03
Confirming patch #16 🐛 Fix TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in Language Drop down Block class Fixed worked for 8.x-2.0 → on Drupal 9.5.8 and PHP 8.1.
Thanks @rajab-natshah ! - 🇨🇭Switzerland CedricCrettaz
When do you expect to release a new module version correcting this error?
Hello.
thanks for your answer @Rajab Natshah. I had this problem in Drupal version 9.5.5 and your solution solved the problem.
Now I'm using Drupal version 9.5.9, after updating to version 9.5.8 and 9.5.9 I get the following error when selecting the language in the LanguageDropdown:The website encountered an unexpected error. Please try again later.
Error: Call to a member function all() on null in Drupal\lang_dropdown\Form\LanguageDropdownForm->submitForm() (line 347 of /var/www/html/drupal/modules/lang_dropdown/src/Form/LanguageDropdownForm.php)- 🇺🇸United States thhafner Chicago, IL
Agreed with above posters. This issue isn't really fixed until there is an actual release of the module with patch #16 🐛 Fix TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in Language Drop down Block class Fixed included.