- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
This will need a test case to show the issue.
Did not test for the issue.
- 🇬🇧United Kingdom nlisgo
This seems to be clearly described. Tagged as Needs tests and it should be easy to add a test.
- Assigned to nlisgo
- Merge request !8584Allow default title arguments to be overridden and improve tests → (Open) created by nlisgo
- Status changed to Needs review
6 months ago 1:05pm 30 June 2024 - Status changed to Needs work
6 months ago 2:44pm 9 July 2024 - 🇺🇸United States smustgrave
Can issue summary be updated using the issue template please
- Issue was unassigned.
- 🇮🇳India shalini_jha
I have tested MR 8584, and after these changes, when the parameter is available in the URL, the getTitle method returns the value from the URL parameter instead of the static value from the routing. Additionally, I have updated the issue summary.
Moving this to NR, Kindly review. - 🇮🇳India Vivek Panicker Kolkata
Thanks @shalini.
@smustgrave the issue summary is fixed and MR is tested now.
- 🇺🇸United States smustgrave
This issue needs a rebase 488 commits behind, the pipeline can't be reliable at that point.
- 🇮🇳India shalini_jha
I have rebased this MR, and the pipeline has passed successfully. Moving it to 'Needs Review'.
Kindly review. - 🇺🇸United States smustgrave
So see that 2 tests have been added but when the test-only feature is ran only testStaticTitleWithDefaultArgumentsOverridden is failing.
- 🇮🇳India shalini_jha
I have verified that the
testStaticTitleWithDefaultArguments
method checks the default behaviour of using static titles with preset arguments without testing dynamic overrides, which is why it does not fail. The issue is specifically addressed intestStaticTitleWithDefaultArgumentsOverridden
, where dynamic URL parameters should replace default values but are not being applied correctly.Please let me know if we should remove the method that tests the default functionality. Moving this to "Needs Review."
- 🇺🇸United States smustgrave
Lets consolidate them. The code seems very similar so probably overlaps.
- 🇮🇳India shalini_jha
I have consolidated both test methods into a single one and tested it. It is working as expected. Moving this to NR for review. Kindly review.
Failing test :
PHPUnit 10.5.38 by Sebastian Bergmann and contributors. Runtime: PHP 8.3.12 Configuration: /var/www/html/core/phpunit.xml.dist F 1 / 1 (100%) Time: 00:04.851, Memory: 186.00 MB There was 1 failure: 1) Drupal\Tests\Core\Controller\TitleResolverTest::testStaticTitleWithArguments Failed asserting that two objects are equal. --- Expected +++ Actual @@ @@ Drupal\Core\StringTranslation\TranslatableMarkup Object ( 'string' => 'static title @test @test2' 'arguments' => Array ( - '@test' => 'override value' + '@test' => 'value' '%test' => 'override value' '@test2' => 'value2' ) /var/www/html/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php:153
- 🇳🇿New Zealand quietone
I read the IS, comments and the MR. This looks in order. I don't know much about routing so did some investigation.
The code being changed was added in 2014 in [ #2120235] but it doesn't address the purpose of the
_title_arguments
. The Structure of routes → states_title_arguments: Additional arguments for the title text passed along to t().
If that is true then I wonder if this is working as designed. If it is not this needs a title update.