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.
With the orientation on rules standards for token replacement related modules are broken e.g. commerce_email and commerce_invoice_email.
There is now a lot of work to get these modules together again especially with documentation in all related modules.
Related issues:
Comment | File | Size | Author |
---|---|---|---|
#19 | variable_mail-1759140-19-token-api.patch | 2.99 KB | Denes.Szabo |
#17 | 1759140-17-token-api.patch | 3.15 KB | mr.york |
#10 | 1759140-10-token-api.patch | 3.23 KB | bradjones1 |
#3 | 1759140-3-fix-tokens.patch | 3.07 KB | lathan |
#2 | 1759140-2-fix-tokens.patch | 3.01 KB | lathan |
Comments
Comment #1
lathanIt looks like the patch that went into this module #1682730: Use standard rules token evaluation was dependant on the patch to rules #1547160: Support variable substitution in direct input mode which was rejected in-favour of #812058: add token support for non-entities basically putting back the changes from the path #1682730: Use standard rules token evaluation makes this function once again.
Comment #2
lathanHere is a patch that does this.
Comment #3
lathanSmall fix missing include.
Comment #4
Summit CreditAttribution: Summit commentedHi,
Is this patch also needed when you use Alpha1? It seems that Alpha1 is recommended to get Tokens instead of Token placeholders..
EDIT I think it is not needed for Aplha1, but for commerce-order:commerce-customer-billing it is not working, still only shows placeholder...
greetings, Martijn
Comment #5
ShaneOnABike CreditAttribution: ShaneOnABike commentedCONFIRMED this totally works and has literally saved me. Please apply this patch! No tokens were being applied properly until I applied this patch (it works in the correct languages too)
@Summit: Yes this is still a huge problem in Alpha1. I had it all working before but then it stopped working again which was super confusing for me.
@jucallme - THANKS so much this is totally saved the hair that remains on my head (half ripped out in wondering what the heck was going on)
PS - You had this set to documentation I changed it to code
Comment #6
akalata CreditAttribution: akalata commentedThis patch got most of the required tokens working again (after #34 at #1559844: Field token is not replaced when fields are blank recommended upgrading from alpha1 to dev), but not the optional field tokens -- leaving me back where I started, but at least fixing the issue introduced by #1682730: Use standard rules token evaluation.
Comment #7
kevster CreditAttribution: kevster commented@summit - this patch worked for me when applied to the dev version. I did try the other method of using message + mesage notify etc but still couldnt get the address tokens working and had HTML issues so reverted back to variable email + commerce email.
@akalata - this may fix your blank issue if you havent found a fix already?
@shaneonabike - using the dev introduced the blank field issue but adding this (taken from https://drupal.org/node/1559844 #34):
(apologies I havent learnt patching yet...)
after line 132 of variable_email.rules.inc (dev version) then fixes the blank tokens so doesnt print out the token name.
so you end up with:
This one has been driving me round the bend, Ive spent at least two days trying various module versions, patches and hacks. I still cant use the address tokens:
[commerce-order:commerce-customer-billing:commerce-customer-address] or
[commerce-order:commerce-customer-billing:commerce_customer_address]
[commerce-order:commerce-customer-shipping:commerce-customer-address] or
[commerce-order:commerce-customer-shipping:commerce_customer_address]
so have ended up having to pull in individual tokens e.g.
SHIP TO:
[commerce-order:commerce-customer-shipping:commerce-customer-address:name_line]
[commerce-order:commerce-customer-shipping:commerce-customer-address:first_name] [commerce-order:commerce-customer-shipping:commerce-customer-address:last_name]
[commerce-order:commerce-customer-shipping:commerce-customer-address:organisation_name]
[commerce-order:commerce-customer-shipping:commerce-customer-address:thoroughfare]
[commerce-order:commerce-customer-shipping:commerce-customer-address:administrative_area]
[commerce-order:commerce-customer-shipping:commerce-customer-address:locality]
[commerce-order:commerce-customer-shipping:commerce-customer-address:sub_locality], [commerce-order:commerce-customer-shipping:commerce-customer-address:postal_code]
[commerce-order:commerce-customer-shipping:commerce-customer-address:country]
but at least im getting tokens in the order email and blanks where no data...
Comment #8
lmeurs CreditAttribution: lmeurs commented#3 so far works for me. This patch brings back code that was removed from the 7.x-1.0-alpha1 version (#1682730: Use standard rules token evaluation).
The patch probably needs another adjustment:
should become:
Comment #9
Danny EnglanderI just applied the patch from #3 to the latest dev and am now getting this error resulting in a WSOD on the front end of my site:
Error: parse error in /sites/all/modules/contrib/variable_email/variable_email.rules.inc, line 147
As far as I can tell the patch applied cleanly. The odd part is line 147 in the patched file is simply a blank line.
Comment #10
bradjones1Here's a patch which fixes the WSOD (missing } at end of file) as well as incorporates feedback from #8 and #7. Re-rolled against -dev and seems to work for me with token and rules -dev versions.
Comment #11
xurizaemonThe following two patches appear to reverse each other?
@highrockmedia, the patch in #3 here is missing a final
}
. With that, you'd revert back to Variable Email with edb34a89 removed.I'm using that currently, but I suspect the proper fix is to identify why the change in edb34a89 doesn't apply to some actions (because
isset($element->settings['variable:process'])
is not set for the emails I'm sending).I have to put this issue down now but hope to come back to it.
[EDIT: I see Brad was making patches while I was typing, nice one Brad!]
Comment #12
Frederic wbase CreditAttribution: Frederic wbase commentedI can confirm that the path of bradjones in 10 is working like a charm, thanks for your work m8.
RTBC?
grts
Frederic
Comment #13
a.milkovsky#10 works, thank you!
Comment #14
4kant CreditAttribution: 4kant commented#10 is working.
Thanks!
Comment #15
drifter CreditAttribution: drifter commentedAlso confirming that applying #10 makes tokens resolve again. Please commit.
Comment #16
GiorgosK#10 solves tokens not replaced
please commit its already tested and reviewed by many
Comment #17
mr.york CreditAttribution: mr.york commentedReroll the patch.
Comment #18
geek-merlinAlso see https://www.drupal.org/project/variable_mimemail
Comment #19
Denes.Szabo CreditAttribution: Denes.Szabo as a volunteer commentedRe-rolled the patch to apply from the module's directory.