Closed (fixed)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Mar 2020 at 07:31 UTC
Updated:
3 Aug 2020 at 18:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
swatichouhan012 commentedHere is patch to fix t calls, kindly review.
Comment #4
prabha1997 commentedComment #5
prabha1997 commentedKindly review new patch
Comment #6
martin107 commentedMy 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.
Comment #7
tr commented+1 RTBC
Patch still applies, tests still run green.
Comment #8
kbrodej commentedHi. 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.
Comment #9
tr commentedIf 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.
Comment #10
kbrodej commentedHi. Nice catch. Attaching a patch with injected service as suggested in #9
Comment #11
Pooja Ganjage commentedHii,
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
Comment #12
tr commentedThe 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.
Comment #13
Pooja Ganjage commentedComment #14
berdirSeems 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.