- Merge request !4Issue #3287889: Automated Drupal 10 compatibility fixes โ (Closed) created by jonnyhocks
- First commit to issue fork.
- Merge request !5Issue #3287889: Automated Drupal 10 compatibility fixes โ (Merged) created by jonnyhocks
- ๐ฌ๐งUnited Kingdom jonnyhocks
I've created a fork and opened a merge request after having applied the patch in #6
- Status changed to RTBC
over 1 year ago 11:23am 11 April 2023 - ๐ฎ๐ณIndia NishaVaghela
I have applied and tested the patch in comment #6, the module is working as expected.
The module in now compatible to Drupal10 , thus moving the issue to RTBC. - ๐ณ๐ฟNew Zealand xurizaemon ลtepoti, Aotearoa ๐
Patch here doesn't apply for me to the current release, but does apply if I install the 1.x-dev release + patch.
composer require 'drupal/hierarchical_term_formatter:1.x-dev#26e21f18e'
- last update
over 1 year ago 13 pass - ๐ฆ๐นAustria jovan1348
You will also need this patch, couse render() function in not more availble in D10, and replaced with Drupal secrvice
- ๐ฎ๐ณIndia deepaksingh05
If you are using 8.x-1.2 version then you can use this Patch!
diff --git a/hierarchical_term_formatter.info.yml b/hierarchical_term_formatter.info.yml index c35f933..257b53f 100644 --- a/hierarchical_term_formatter.info.yml +++ b/hierarchical_term_formatter.info.yml @@ -2,7 +2,7 @@ type: module name: Hierarchical Term Formatter description: 'Provides hierarchical term formatters for taxonomy reference fields.' package: Field Formatters -core_version_requirement: ^8.7.7 || ^9 +core_version_requirement: ^9.3 || ^10 # Information added by Drupal.org packaging script on 2020-05-24 version: '8.x-1.2' diff --git a/hierarchical_term_formatter.theme.inc b/hierarchical_term_formatter.theme.inc index b18dc9d..0f0e6a8 100755 --- a/hierarchical_term_formatter.theme.inc +++ b/hierarchical_term_formatter.theme.inc @@ -23,7 +23,7 @@ function template_preprocess_hierarchical_term_formatter(array &$variables) { $url = new Url('entity.taxonomy_term.canonical', ['taxonomy_term' => $term->id()]); $link = Link::fromTextAndUrl($term->getName(), $url); $link = $link->toRenderable(); - $terms[] = render($link); + $terms[] = \Drupal::service('renderer')->render($link); } else { $terms[] = $term->getName(); diff --git a/tests/src/Functional/HierarchicalTermFormatterErrorTest.php b/tests/src/Functional/HierarchicalTermFormatterErrorTest.php index 80ba55b..1e7e858 100755 --- a/tests/src/Functional/HierarchicalTermFormatterErrorTest.php +++ b/tests/src/Functional/HierarchicalTermFormatterErrorTest.php @@ -41,7 +41,7 @@ class HierarchicalTermFormatterErrorTest extends BrowserTestBase { * * @var array */ - public static $modules = [ + protected static $modules = [ 'user', 'node', 'taxonomy', @@ -52,7 +52,7 @@ class HierarchicalTermFormatterErrorTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); // Create a tree we can work on. $items = [ @@ -88,7 +88,7 @@ class HierarchicalTermFormatterErrorTest extends BrowserTestBase { $this->drupalLogin($this->user); $this->drupalGet("node/$nid/preview/$view_mode"); - $this->assertResponse(200); + $this->assertSession()->statusCodeEquals(200); // Should be the same if we remove the term. $term = $this->container->get('entity_type.manager')->getStorage('taxonomy_term')->load($this->createdTerms['1.1.1']); @@ -96,7 +96,7 @@ class HierarchicalTermFormatterErrorTest extends BrowserTestBase { $this->container->get('cache_tags.invalidator')->invalidateTags($node->getCacheTagsToInvalidate()); $this->drupalGet("node/$nid/preview/$view_mode"); - $this->assertResponse(200); + $this->assertSession()->statusCodeEquals(200); $this->drupalLogout(); } diff --git a/tests/src/Functional/HierarchicalTermFormatterTest.php b/tests/src/Functional/HierarchicalTermFormatterTest.php index f24429c..c9065b3 100755 --- a/tests/src/Functional/HierarchicalTermFormatterTest.php +++ b/tests/src/Functional/HierarchicalTermFormatterTest.php @@ -47,7 +47,7 @@ class HierarchicalTermFormatterTest extends BrowserTestBase { * * @var array */ - public static $modules = [ + protected static $modules = [ 'user', 'node', 'taxonomy', @@ -73,7 +73,7 @@ class HierarchicalTermFormatterTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); // Create a tree we can work on. $items = [ @@ -126,7 +126,7 @@ class HierarchicalTermFormatterTest extends BrowserTestBase { $expected_value = $this->generateLinkString($expected_value['items'], $expected_value['separator']); } $this->drupalGet("node/$nid/preview/$display_mode"); - $this->assertRaw(">$expected_value<"); + $this->assertSession()->responseContains(">$expected_value<"); } $this->drupalLogout();
- ๐ฎ๐ณIndia deepaksingh05
If you are using 8.x-1.2 version then you can use this Patch!
- ๐ณ๐ฑNetherlands pefferen
Patch in #17 works nicely on our codebase, please merge
Have been running patch in#17 for a few days on Drupal 10 now and haven't encountered any issues yet.
- ๐น๐ญThailand Nick Hope
Composer successfully applies #6 to 8.x.1.x-dev and it works for me in D9.5.11.
The change in #15 was already included in #6 (and in #17).
#17 is very similar to #6 but I can't get Composer to apply it to 8.x-1.2.
- First commit to issue fork.
-
AstonVictor โ
committed 1b46b94f on 8.x-1.x authored by
jonnyhocks โ
Issue #3287889: Automated Drupal 10 compatibility fixes
-
AstonVictor โ
committed 1b46b94f on 8.x-1.x authored by
jonnyhocks โ
- Status changed to Fixed
12 months ago 1:54pm 4 January 2024 - ๐บ๐ฆUkraine AstonVictor
The MR was merged.
Changes will be added to the next release.
Also, checked the module with CS and PhpStan. Automatically closed - issue fixed for 2 weeks with no activity.