This looks like an issue in HEAD as well - there was no implementation of hook_token_values() or hook_token_list() from the token module.
This patch is resolving the issue in our test environment; our shipping notification emails are properly replacing values (e.g. [txn-id] is becoming '17')
| Comment | File | Size | Author |
|---|---|---|---|
| shipping.diff_.patch | 5.49 KB | dgorton |
Comments
Comment #1
djflux commentedDo you receive tags around your replaced tokens? e.g. When I go to the shipping notify for a transaction the following is displayed for [txn-items]:
However, it's only on certain tokens (txn-items, txn-ship-to). Some tokens seem to work fine (txn-id, txn-order-date).
Thanks,
Flux.
Comment #2
skwashd commentedin 5.x-3-dev at line 753 of shipping.module the following is required
$items .= t('!order of !title at !price each', array('!order' => format_plural($p->qty, '1 order', '!count orders'), '!title' => $p->title, '!price' => payment_format($p->price))). "\n";
instead of what is contained in the patch.
Comment #3
skwashd commentedThere is a couple more tokens which need to use ! not % the order items listing is one of them
Comment #4
cboshuizen commentedThere is no need to add the token functions to the shipping module, especially since the code is identical. I traced the function calls and the ones you added are never called.
The problem seems to be the incorrect number of parameters in the function call
return ec_mail_send_mid($mid, $to, ECMAIL_TYPE_CUSTOMER_INVOICE, $t);in store.module. If you check ec_mail.module you can seefunction ec_mail_send_mid($mid, $to, $object = NULL, $from = NULL, $preview = FALSE)where $object is the third item, but in the call it is the fourth. If I changed the function to
function ec_mail_send_mid($mid, $to, $type=NULL, $object = NULL, $from = NULL, $preview = FALSE)then everything works fine.
Because I changed the function, I had to go and find all instances of where it was called and check our object ($t) was in the right place in the function call. Alternatively, just delete ECMAIL_TYPE_CUSTOMER_INVOICE from the one function call above.
Comment #5
cboshuizen commentedThere is no need to add the token functions to the shipping module, especially since the code is identical. I traced the function calls and the ones you added are never called.
The problem seems to be the incorrect number of parameters in the function call
return ec_mail_send_mid($mid, $to, ECMAIL_TYPE_CUSTOMER_INVOICE, $t);in store.module. If you check ec_mail.module you can seefunction ec_mail_send_mid($mid, $to, $object = NULL, $from = NULL, $preview = FALSE)where $object is the third item, but in the call it is the fourth. If I changed the function to
function ec_mail_send_mid($mid, $to, $type=NULL, $object = NULL, $from = NULL, $preview = FALSE)then everything works fine.
Because I changed the function, I had to go and find all instances of where it was called and check our object ($t) was in the right place in the function call. Alternatively, just delete ECMAIL_TYPE_CUSTOMER_INVOICE from the one function call above.
Comment #6
cboshuizen commentedThere is no need to add the token functions to the shipping module, especially since the code is identical. I traced the function calls and the ones you added are never called.
The problem seems to be the incorrect number of parameters in the function call
return ec_mail_send_mid($mid, $to, ECMAIL_TYPE_CUSTOMER_INVOICE, $t);in store.module. If you check ec_mail.module you can seefunction ec_mail_send_mid($mid, $to, $object = NULL, $from = NULL, $preview = FALSE)where $object is the third item, but in the call it is the fourth. If I changed the function to
function ec_mail_send_mid($mid, $to, $type=NULL, $object = NULL, $from = NULL, $preview = FALSE)then everything works fine.
Because I changed the function, I had to go and find all instances of where it was called and check our object ($t) was in the right place in the function call. Alternatively, just delete ECMAIL_TYPE_CUSTOMER_INVOICE from the one function call above.
Comment #7
cboshuizen commentedThere is no need to add the token functions to the shipping module, especially since the code is identical. I traced the function calls and the ones you added are never called.
The problem seems to be the incorrect number of parameters in the function call
return ec_mail_send_mid($mid, $to, ECMAIL_TYPE_CUSTOMER_INVOICE, $t);in store.module. If you check ec_mail.module you can seefunction ec_mail_send_mid($mid, $to, $object = NULL, $from = NULL, $preview = FALSE)where $object is the third item, but in the call it is the fourth. If I changed the function to
function ec_mail_send_mid($mid, $to, $type=NULL, $object = NULL, $from = NULL, $preview = FALSE)then everything works fine.
Because I changed the function, I had to go and find all instances of where it was called and check our object ($t) was in the right place in the function call. Alternatively, just delete ECMAIL_TYPE_CUSTOMER_INVOICE from the one function call above.
Comment #8
cboshuizen commentedThere is no need to add the token functions to the shipping module, especially since the code is identical. I traced the function calls and the ones you added are never called.
The problem seems to be the incorrect number of parameters in the function call
return ec_mail_send_mid($mid, $to, ECMAIL_TYPE_CUSTOMER_INVOICE, $t);in store.module. If you check ec_mail.module you can seefunction ec_mail_send_mid($mid, $to, $object = NULL, $from = NULL, $preview = FALSE)where $object is the third item, but in the call it is the fourth. If I changed the function to
function ec_mail_send_mid($mid, $to, $type=NULL, $object = NULL, $from = NULL, $preview = FALSE)then everything works fine.
Because I changed the function, I had to go and find all instances of where it was called and check our object ($t) was in the right place in the function call. Alternatively, just delete ECMAIL_TYPE_CUSTOMER_INVOICE from the one function call above.
Comment #9
cboshuizen commentedSorry for the multiple posts. Drupal was dumping tonnes of database errors when I posted this message and I had no idea it had gone through.
Can someone please delete the successive comments?
Thanks,
Chris
Comment #10
dgorton commentedAgreed - my patch is ugly; duplicate code is not a good thing. I mentioned that in other places, but not in this actual patch post - my bad.
In any case, however, I'm quite sure this code was being called as it resolved the issue in our environment and it helped us meet a deadline. We were using a 4.7 install, however, so it may be somewhat different than the HEAD / 5.x branch.
regardless of all of that, however, it's duplicate code and that sort of thing needs to be solved by sharing, generalization or otherwise squashed in some manner.
Drew
Comment #11
brmassa commentedGuys,
its fixed on eC4.
regards,
massa