- Issue created by @yashmalviya
- ๐ฎ๐ณIndia keshavv India
keshav.k โ made their first commit to this issueโs fork.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:02am 11 May 2023 - last update
over 1 year ago 2 fail The last submitted patch, 3: t()_calls_should_be_avoided-3359562-2.patch, failed testing. View results โ
- Assigned to akshaydalvi212
- Status changed to Needs work
over 1 year ago 9:46am 11 May 2023 - ๐ฎ๐ณIndia akshaydalvi212
hey @yashmalviya,
Thank you for the patch but while applying the patch getting errors as shown in the image.
will make changes the also raise the MR which will remove the reporting errors.
- last update
over 1 year ago 2 fail - @akshaydalvi212 opened merge request.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:16am 11 May 2023 - ๐ฎ๐ณIndia akshaydalvi212
Updated the code and raised the MR for removing the reported errors.
Kindly review the MR. - last update
over 1 year ago 2 fail - ๐ฎ๐ณIndia yashmalviya
Hello @akshaydalvi212
I have updated the changes. Please review The last submitted patch, 10: t()_calls_should_be_avoided-3359562-10.patch.patch, failed testing. View results โ
- First commit to issue fork.
- last update
over 1 year ago 4 pass - ๐ฎ๐ณIndia sumit-k
Hi, I tried to replicate the issue but didn't get it while testing Drupal 10.09 with PHP 8.1. To address the issue mentioned, it would be helpful if you could provide more specific details about the problem you encountered. Please provide the steps to reproduce the issue, any error messages or warnings you received, and any relevant configurations or code snippets.
- last update
over 1 year ago 4 pass - ๐ฎ๐ณIndia sumit-k
FILE: /var/www/html/modules/real/realname/tests/src/Functional/RealnameBasicTest.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 83 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /var/www/html/modules/real/realname/src/Controller/RealnameAutocompleteController.php ------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------- 24 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines ------------------------------------------------------------------------------------------------------------------------------------- Time: 223ms; Memory: 10MB
Getting the following issues on running phpcs with standard Drupal and DrupalPractice. Attaching patch for fixes. Please review.
- Status changed to Needs work
over 1 year ago 10:25am 7 July 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Since the purpose of this issue is avoiding t() calls in classes, the MR should focus on that. Differently, this issue would become a Fix the issues reported by phpcs issue.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Also, the issue summary, instead of quoting part of the PHP_CodeSniffer report, should say which files must be changed.
Let's focus ont()
calls, instead of adding also the changes to be done on the .info.yml file. - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
See the
ConfigEntityTest
class, which contains the following code.$this->assertSession()->pageTextContains('0 configuration has been created.');
It does not use
t()
nor$this->t()
. - ๐ฎ๐ณIndia sumit-k
Removed t() function. Sharing new patch. Please review.
- Status changed to Needs review
over 1 year ago 12:16pm 7 July 2023 - last update
over 1 year ago 4 pass - ๐ฎ๐ณIndia sidharth_soman Bangalore
Both t_calls_should_be_avoided-3359562-12.patch and 3359562-22.patch apply cleanly and remove the 3 occurrences of the t() function.
- last update
over 1 year ago 4 pass - ๐ฎ๐ณIndia keshavv India
@apaderno I have reverted the other changes. Now we can go with the MR.
Thank you.