Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It's a one-liner fix.
Wrong:
t('The following From address failed: !from', array('!from' => $smtp_from)),
Right:
t('The following From address failed: @from', array('@from' => $smtp_from)),
See also:
https://www.drupal.org/node/2575819
Comment | File | Size | Author |
---|---|---|---|
#24 | fixes_t_arguments-2843350-24.patch | 2.87 KB | wundo |
|
Comments
Comment #2
estoyausenteChanged all !var placeholders and replaced with @var in t functions.
Comment #3
cppg CreditAttribution: cppg commentedIt's not ok, I'm afraid. @!smail is not a correct syntax, it should be @smail.
First 4 lines are not ok, last 2 are ok.
Comment #4
estoyausenteYo're right!. I will be do asap.
Comment #5
pawel_r CreditAttribution: pawel_r commentedThx #2.
After applying this patch e-mails from Contact Forms are being send properly.
Drupal 8.2
Comment #6
mgoncalves CreditAttribution: mgoncalves at CI&T commentedComment #7
mgoncalves CreditAttribution: mgoncalves at CI&T commentedThe issue reported was fixed, but I have a question about the t() function.
In this case, should I use the $this->t() or keep only t() ?
Comment #8
mgoncalves CreditAttribution: mgoncalves at CI&T commentedComment #9
gg24 CreditAttribution: gg24 as a volunteer and at QED42 commentedHi @mgoncalves,
It should be this->t() as t() has been deprecated and will be removed in Drupal 9.
Thanks!
Comment #10
gg24 CreditAttribution: gg24 as a volunteer and at QED42 commentedComment #11
mgoncalves CreditAttribution: mgoncalves at CI&T commentedComment #12
estoyausente@mgoncalves you cannot use $this->t because the code inside SMTP class is an external library, not a real Drupal class. Set inside this file a Drupal t function is a dirty way of resolve a problem that have to be resolve including the original library using composer or something similar.
@see https://www.drupal.org/node/2711559
Comment #13
mgoncalves CreditAttribution: mgoncalves at CI&T commentedHello @estoyausente,
I thought about that, Drupal 8 is keeping some hooks, and we cannot use $this->t inside hooks as well, do you ?
At this bug, the only thing I have seen is about the change from ! to @.
Do you have any point to add or the last patch I sent is satisfacting ?
Comment #14
estoyausenteThe last past seems perfect but (viewing the code) but I haven't enough time to test in in my local environment. For this reason I don't change the issue status to RTBC :-)
Comment #15
estoyausenteComment #16
gg24 CreditAttribution: gg24 as a volunteer and at QED42 commentedHi @mgoncalves,
Your patch works as intended.
Thanks!
Comment #17
gg24 CreditAttribution: gg24 as a volunteer and at QED42 commentedComment #18
mgoncalves CreditAttribution: mgoncalves at CI&T commentedComment #19
arnoldbird CreditAttribution: arnoldbird commentedLooks like this patch has not been applied to the dev branch yet.
Comment #20
arnoldbird CreditAttribution: arnoldbird commentedComment #21
arnoldbird CreditAttribution: arnoldbird commentedThe patch in #7 is working for me. I no longer get the relevant error when I apply the patch to the latest dev code.
I can't send emails yet, but I think that's due to an unrelated issue.
Comment #22
wundo CreditAttribution: wundo at Chuva Inc. commentedPatch needs a re-roll, I'm going to manually fix it and commit.
Comment #23
wundo CreditAttribution: wundo at Chuva Inc. commentedComment #24
wundo CreditAttribution: wundo at Chuva Inc. commentedHere it goes!
Comment #26
wundo CreditAttribution: wundo at Chuva Inc. commentedAs everything passed, I think this new patch is good to go :)
Comment #28
wundo CreditAttribution: wundo at Chuva Inc. commentedComment #30
pianomansam CreditAttribution: pianomansam commentedCan we can a full release with this fix? It's been 12 months since it was committed to dev.
Comment #31
lukus+1 for release