- šŗšø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 ā (Closed) created by nlisgo
- Status changed to Needs review
7 months ago 1:05pm 30 June 2024 - Status changed to Needs work
7 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.
- š¬š§United Kingdom alexpott šŖšŗš
This is a change in behaviour. Potentially someone might be relying on the ability of _title_arguments to override the arguments based on the routes raw parameters. That means I think we need a change record. Unfortunately there is no documentation in core about _title_arguments as ideally the behaviour should be documented there. The change being made here however is inline with the documentation linked to from #32 as this now means that _title_arguments can only define additional arguments and values and not override stuff coming from the route.
- š®š³India shalini_jha
Thank you for the review and feedback. Based on the suggestions provided, I tested the functionality after implementing the recommended changes, and it is now working as expected. There is no need for an array_merge after retrieving the arguments from _raw_variables. I also re-ran the tests, and they are passing successfully.
I have also drafted a CR ā based on the work done and provided an explanation of the changes made. However, Iām unsure if anything else needs to be added. I kindly request you to review it and share your feedback. Thank you!
- šŗšøUnited States smustgrave
Think the title of the MR probably makes more sense.
CR seems well detailed
Believe all feedback has been addressed.
-
alexpott ā
committed 0c9b4fcd on 11.x
Issue #3081044 by shalini_jha, nlisgo, vivek panicker, smustgrave,...
-
alexpott ā
committed 0c9b4fcd on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.