Add core_version_requirement: ^8 || ^9 to languageicons.info.yml to designate that the theme is compatible with Drupal 9.
See https://www.drupal.org/node/3070687.
drupal-check & rector reports below :-
vendor/bin/rector process web/modules/contrib/languageicons --dry-run
Rector 0.8.x-dev@8896f0a
Config file: rector.yml
9/9 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
2 files with changes
====================
1) web/modules/contrib/languageicons/languageicons.module
---------- begin diff ----------
--- Original
+++ New
@@ -1,4 +1,6 @@
<?php
+use Drupal\Core\Url;
+use Drupal\Component\Utility\Html;
/**
* @file
* Icons for language links.
@@ -38,7 +40,7 @@
$output .= '<p>' . t('For more information, please see <a href="@handbook">the online handbook section</a>.', array('@handbook' => 'http://drupal.org/node/133977')) . '</p>';
return $output;
case 'admin/config/regional/language/icons':
- $output = '<p>' . t('To enable multilingual support for specific content types go to <a href="@configure_content_types">configure content types</a>.', array('@configure_content_types' => \Drupal\Core\Url::fromRoute('entity.node_type.collection'))) . '</p>';
+ $output = '<p>' . t('To enable multilingual support for specific content types go to <a href="@configure_content_types">configure content types</a>.', array('@configure_content_types' => Url::fromRoute('entity.node_type.collection'))) . '</p>';
return $output;
}
}
@@ -104,7 +106,7 @@
if ($path = \Drupal::config('languageicons.settings')->get('path')) {
$variables['icon'] = [
'#theme' => 'image',
- '#uri' => str_replace('*', $language->getId(), \Drupal\Component\Utility\Html::escape($path)),
+ '#uri' => str_replace('*', $language->getId(), Html::escape($path)),
'#alt' => $title,
'#title' => $title,
'#width' => $width,
----------- end diff -----------
2) web/modules/contrib/languageicons/src/Form/LanguageiconsAdminSettings.php
---------- begin diff ----------
--- Original
+++ New
@@ -40,7 +40,7 @@
return ['languageicons.settings'];
}
- public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
+ public function buildForm(array $form, FormStateInterface $form_state) {
$form['show'] = [
'#type' => 'fieldset',
'#title' => t('Add language icons'),
----------- end diff -----------
[OK] Rector is done! 2 files would have changed (dry-run).
vendor/bin/drupal-check -ad web/modules/contrib/languageicons
3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] No errors
Comments
Comment #2
rahulrasgon commentedAdded a patch. Kindly review.
Comment #3
rahulrasgon commentedComment #4
hardik_patel_12 commentedpatch #2 applies cleanly and installed this on Drupal 9 instance.
Ran drupal-check and found no issues:
Comment #5
kristen polComment #6
heddn+1 on RTBC. And after landing this, can we get a new tagged beta release?
These changes aren't strictly needed for D9 compatibility. They could be done as clean-up, but the key thing is the core version requirement change.
Comment #7
pfrenssenComment #8
pfrenssenThanks!