Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kavitasonawane created an issue. See original summary.

kavitasonawane’s picture

Status: Active » Needs review
StatusFileSize
new3.09 KB
Swapnil_Kotwal’s picture

StatusFileSize
new3.14 KB
sudishth’s picture

Status: Needs review » Needs work

#3 error: corrupt patch at line 53

sudishth’s picture

Version: 8.x-3.0 » 9.0.x-dev

amritsingh09 made their first commit to this issue’s fork.

mrinalini9’s picture

Status: Needs work » Needs review
StatusFileSize
new3.09 KB

Rerolled patch #3 for the 9.0.x branch, please review it.

lalitkyttn’s picture

I have added string translation trait and fixed drupal coding standard issues

dharti patel’s picture

Assigned: Unassigned » dharti patel

I'll review this patch.

dharti patel’s picture

Assigned: dharti patel » Unassigned
StatusFileSize
new8.33 KB

I've reviewed the #8 patch but after applying the patch below errors are shown:

FILE: /home/drupal/myproject/date_range_formatter/date_range_formatter.install
------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------
 13 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
------------------------------------------------------------


FILE: /home/drupal/myproject/date_range_formatter/date_range_formatter.module
------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------
 3 | ERROR | Missing short description in doc comment
------------------------------------------------------------


FILE: /home/drupal/myproject/date_range_formatter/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php
------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------
 82 | WARNING | Only string literals should be passed to t() where possible
 93 | WARNING | Line exceeds 80 characters; contains 86 characters
 95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 95 | WARNING | Only string literals should be passed to t() where possible
------------------------------------------------------------


FILE: /home/drupal/myproject/date_range_formatter/date_range_formatter.info.yml
------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------
 7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
------------------------------------------------------------

I have created a patch to fix this issue. Kindly review the patch

Thanks!

mpaulo’s picture

Assigned: Unassigned » mpaulo

The provided patches falls outside the scope of this issue, which should focus only on solving the 't' calls.
Also, on the last patch, the call to a translation method was removed altogether (line 111).

-          $elements[$delta] = ['#markup' => \Drupal::service('date.formatter')->format($start_date, 'custom', t($single_format))];
+          $elements[$delta] = ['#markup' => \Drupal::service('date.formatter')->format($start_date, 'custom', ($single_format))];

The issue scope can be updated by a mantainer, or by the reporter, but for now, I'll review the last patch containing only corrections to t calls.

mpaulo’s picture

StatusFileSize
new4.91 KB

I had to reroll the #7 patch to commit 8808a9c, and I've corrected more t calls violations.

mpaulo’s picture

StatusFileSize
new4.91 KB

Please, ignore patch #12, there were some lines of code I added back from a previous commit.

mpaulo’s picture

Assigned: mpaulo » Unassigned
alexanderj’s picture

Assigned: Unassigned » alexanderj

I will review it.

alexanderj’s picture

Assigned: alexanderj » Unassigned
Status: Needs review » Reviewed & tested by the community

I revised the patch and the t() function usage warnings were fixed.
Moving it to RTBC.

  • sudishth committed 9a68398b on 9.0.x authored by mpaulo
    Issue #3151725 by mpaulo, kavitasonawane, Swapnil_Kotwal: t() calls...
sudishth’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.