CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?
Pages: [1]

Author Topic: CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?  (Read 3262 times)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?
July 03, 2008, 04:45:04 pm
I'm using CiviCRM 1.9.13019, and when the reciept message for memberships gets sent out, the Billing Name value (i.e., what should be the name on the Credit Card) turns into things like "Birth Day" (i.e. the label for a custom field).

I suspect CRM/Contribute/Form/Contribution/ReceiptMessage.tpl because it's using $name to iterate over the custom pre and post fields, and also for the Billing Name value.

I think the billing name should probably come into this template as something more like $billing_name, but for now, I've tried just replacing $name with $cname in the custom field loops (and await some testing).

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?
July 03, 2008, 05:29:52 pm

someone else reported this a couple of weeks back. We've made this fix in 2.1. I've also changed most/all the templates to avoid using the variable 'name' in either the key or item fields. PHP/Smarty scoping in this instance is a bit sucky :(

issue here: http://issues.civicrm.org/jira/browse/CRM-3273

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?
July 07, 2008, 08:50:31 am
good to know, thanks.

my fix didn't work for 1.9 though, sounds like I need to fix it in the code somewhere. Any hints (example? svn revision number?).

 - Alan

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?
July 07, 2008, 03:24:13 pm

hey alan:

might be easier to use billingName for the name variable rather than name.

So can you change:

http://fisheye.civicrm.org/browse/CiviCRM/trunk/CRM/Contribute/Form/ContributionBase.php?r=15610 (line 390)

and fix the templates to use billingName rather than name

might be a shorter quicker fix. my original fix was spread across a few commit and i did not track it to an issue (unfortunately)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?
July 10, 2008, 01:16:00 pm
Ah thank you, that looks like it should work.

i think you've got the wrong line number for v1.9 (since it's in the custom field section). I've appended below the full diffs (also gotta fix those default templates) that I think work (the revisions are our internal ones, not the civicrm svn ones).

If you can just confirm that i needed to do both the assign and set in the first diff below, i'll sleep easier.

 - Alan

Index: CRM/Contribute/Form/ContributionBase.php
===================================================================
--- CRM/Contribute/Form/ContributionBase.php    (revision 1258)
+++ CRM/Contribute/Form/ContributionBase.php    (working copy)
@@ -316,8 +316,8 @@
         }
         $name .= ' ' . CRM_Utils_Array::value( 'billing_last_name', $this->_params );
         $name = trim( $name );
-        $this->assign( 'name', $name );
-        $this->set( 'name', $name );
+        $this->assign( 'billingName', $name );
+        $this->set( 'billingName', $name );
 
         $vars = array( 'amount', 'currencyID',
                        'credit_card_type', 'trxn_id', 'amount_level' );
Index: templates/CRM/Contribute/Form/Contribution/Confirm.tpl
===================================================================
--- templates/CRM/Contribute/Form/Contribution/Confirm.tpl      (revision 1258)
+++ templates/CRM/Contribute/Form/Contribution/Confirm.tpl      (working copy)
@@ -71,7 +71,7 @@
         {ts}Billing Name and Address{/ts}
     </div>
     <div class="display-block">
-        <strong>{$name}</strong><br />
+        <strong>{$billingName}</strong><br />
         {$address|nl2br}
     </div>
     <div class="display-block">
Index: templates/CRM/Contribute/Form/Contribution/ReceiptMessage.tpl
===================================================================
--- templates/CRM/Contribute/Form/Contribution/ReceiptMessage.tpl       (revision 1258)
+++ templates/CRM/Contribute/Form/Contribution/ReceiptMessage.tpl       (working copy)
@@ -56,7 +56,7 @@
 {ts}Billing Name and Address{/ts}
 
 ===========================================================
-{$name}
+{$billingName}
 {$address}
 
 {$email}

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?
July 10, 2008, 01:26:30 pm

yes, that looks right. You should also change the reference to {$name} in ThankYou.tpl

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • CRM/Contribute/Form/Contribution/ReceiptMessage.tpl error?

This forum was archived on 2017-11-26.