- πΊπΈUnited States dww
Thanks for working on this!
-
+++ b/core/modules/taxonomy/src/Plugin/views/field/TermName.php @@ -23,9 +23,10 @@ public function getItems(ResultRow $values) { - // @todo Add link support https://www.drupal.org/node/2567745
I grep'ed 10.1.x branch and confirmed this is the only reference to "2567745". π
-
+++ b/core/modules/taxonomy/src/Plugin/views/field/TermName.php @@ -23,9 +23,10 @@ public function getItems(ResultRow $values) { + empty($this->options['settings']['link_to_entity']) ? + $item['rendered']['#context']['value'] = $name : + $item['rendered']['#title']['#context']['value'] = $name;
I know @alexpott suggested this formulation. Personally, I don't love using ternary operators for conditional execution like this. My preference would be to use
if (...)
for this, since we're setting different variables based on the conditional. But that's just me. π -
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php @@ -48,6 +49,19 @@ public function testTermNameField() { + $this->assertEquals($expected_link1->toString(), $view->getStyle()->getField(0, 'name'));
#13 test-only failed right here, exactly as expected:
1) Drupal\Tests\taxonomy\Functional\Views\TermNameFieldTest::testTermNameField Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'oZZv7opl-u1O4twSP' +'oZZv7opl u1O4twSP' /var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php:96 /var/www/html/core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php:63 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:722
- The fix looks good (personal preference in point 2 notwithstanding). π
- Test coverage is solid and the bot confirmed it's covering the bug.
- The summary and title are accurate.
- I can't see any reason not to commit this, so RTBC.
Thanks again!
-Derek -
The last submitted patch, 23: 2567745-23.patch, failed testing. View results β
The last submitted patch, 23: 2567745-23.patch, failed testing. View results β
-
larowlan β
committed 9f35abc0 on 10.0.x
Issue #2567745 by mohit_aghera, smustgrave, quietone, andypost, dww,...
-
larowlan β
committed 9f35abc0 on 10.0.x
-
larowlan β
committed e3f208ee on 10.1.x
Issue #2567745 by mohit_aghera, smustgrave, quietone, andypost, dww,...
-
larowlan β
committed e3f208ee on 10.1.x
-
larowlan β
committed e46f1e26 on 9.5.x
Issue #2567745 by mohit_aghera, smustgrave, quietone, andypost, dww,...
-
larowlan β
committed e46f1e26 on 9.5.x
- Status changed to Fixed
almost 2 years ago 1:56am 29 March 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Committed to 10.1.x and backported to 9.5.x and 10.0.x
Thanks folks.
I'm with @dww on that syntax, but not going to block the issue on that basis alone.
Automatically closed - issue fixed for 2 weeks with no activity.