Comments

swatichouhan012 created an issue. See original summary.

swatichouhan012’s picture

Assigned: swatichouhan012 » Unassigned
Status: Active » Needs review
StatusFileSize
new12.77 KB

Here is patch to fix t calls, kindly review.

Status: Needs review » Needs work

The last submitted patch, 2: 3117929-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

prabha1997’s picture

Assigned: Unassigned » prabha1997
prabha1997’s picture

Assigned: prabha1997 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new5.77 KB
new5.92 KB

Kindly review new patch

martin107’s picture

Status: Needs review » Reviewed & tested by the community

My review

a) The patch applies against 8.x-4.x
b) After a visual scan of the patch all look good, no extraneous change, all change in keeping with the subject of the issue.
c) When I look at the test result there are no addition coding standard violations.
d) I have searched the module and I think all possible t() changes have been included in the patch.

swatichouhan012++
prabha1997++

thank you

in short this patch improved the module.

tr’s picture

+1 RTBC

Patch still applies, tests still run green.

kbrodej’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new6.36 KB
new663 bytes

Hi. Reviewed the patch. Patch applied cleanly. Did go through the changes and found that t() method was not available in src/FlagType/FlagTypeBase.php, so I added the StringTranslationTrait.

tr’s picture

If you're going to use StringTranslationTrait like that you should also inject the string_translation service - that's only a few more lines of code. StringTranslationTrait::t() does EXACTLY the same thing as t() unless you inject the service.

kbrodej’s picture

StatusFileSize
new9.07 KB
new2.89 KB

Hi. Nice catch. Attaching a patch with injected service as suggested in #9

Pooja Ganjage’s picture

Hii,

I would like to include one more point that,
There are deprecated method mentioned somewhere in the files under tests folder such as assertEqual() and drupalPostAjaxForm() method deprecated and used instead of that assertEquals() and drupalPostFom().

Let me know for this reason.

#10 comment patch works for me.

Thanks

tr’s picture

Status: Needs review » Reviewed & tested by the community

The D9 test failures are branch failures unrelated to this patch.

I have reviewed this patch several times now. It addresses the original post, does not introduce coding standards or other errors, and uses best practices. RTBC.

@Pooja Ganjage : assertEqual() is not removed until Drupal 10. You should open a separate issue for that (please check first to see if this is already part of another issue ...).

drupalPostAjaxForm() is not actually used by the tests currently even though it appears in the code - the function where it appears is never used, so it doesn't cause any errors. There is an open issue (and several closed or related issues) to finish up porting that part of the tests to JavaScript tests. See #2751053: Convert Simpletests to PHPUnit and #3090403: Convert web tests to phpunit. Again, that is something that should be handled in those issues, not here.

Pooja Ganjage’s picture

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Seems a bit inconsistent on injecting the service vs using the inherited trait, using it directory or even both. Don't really care too much though. Committed, thanks.

  • Berdir committed b82b456 on 8.x-4.x
    Issue #3117929 by kbrodej, prabha1997, swatichouhan012, TR: t() calls...

Status: Fixed » Closed (fixed)

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