- Issue created by @Harshita mehra
- Status changed to Needs review
12 months ago 12:19pm 29 June 2023 - last update
12 months ago 9 pass - 🇮🇳India Harshita mehra
Hello Maintainers,
I have provided a patch to fix this issue.
Kindly review it.Thanks!
- 🇮🇳India Raveen Kumar
@Harshita,
a) I have reviewed the code in the patch. The warning message you mentioned is related to Drupal coding standards and best practices. In Drupal, when working with translations, it is recommended to use the $this->t() method instead of the global t() function within classes.b) By using $this->t() instead of t() within classes, you ensure that the translation service is properly injected and available for use. It also improves the testability and maintainability of your code.
Your Patch is good to go. And Thank you.
- Merge request !8Issue #3371326: Replace the t() calls to $this->t() in classes. → (Open) created by Unnamed author
- last update
12 months ago 9 pass - Status changed to RTBC
12 months ago 6:04am 30 June 2023 - 🇮🇳India Akshay kashyap
@Harshita mehna
Thanks for the work.
I have reviewed and tested #2 It is applied successfully and looks good to me. This patch: Remove t() and add $this->t() in the "MenuTrailByPathSettingsForm.php" file.
I have attached the before and after images. Please check.
Moving to RTBC
- Status changed to Needs work
7 months ago 10:04pm 29 November 2023 - 🇨ðŸ‡Switzerland Berdir Switzerland
This is using $this in a static method, so that definitely doesn't work.
- Assigned to nitin_lama
- last update
7 months ago 9 pass - Issue was unassigned.
- Status changed to Needs review
7 months ago 12:22pm 1 December 2023