Index: CRM/Contribute/Form/Contribution.php =================================================================== --- CRM/Contribute/Form/Contribution.php (revision 38177) +++ CRM/Contribute/Form/Contribution.php (working copy) @@ -359,14 +359,14 @@ // Show user link to oldest Pending or Overdue pledge payment require_once 'CRM/Utils/Date.php'; require_once 'CRM/Utils/Money.php'; - $ppAmountDue = CRM_Utils_Money::format($payments['amount'],$payments['currency']); - $ppSchedDate = CRM_Utils_Date::customFormat( CRM_Core_DAO::getFieldValue( 'CRM_Pledge_DAO_PledgePayment', $payments['id'], 'scheduled_date' ) ); + $ppAmountDue = CRM_Utils_Money::format($payments['amount'],$paymentsDue['currency']); + $ppSchedDate = CRM_Utils_Date::customFormat( CRM_Core_DAO::getFieldValue( 'CRM_Pledge_DAO_PledgePayment', $paymentsDue['id'], 'scheduled_date' ) ); if ( $this->_mode ) { $ppUrl = CRM_Utils_System::url( 'civicrm/contact/view/contribution', - "reset=1&action=add&cid={$this->_contactID}&ppid={$payments['id']}&context=pledge&mode=live" ); + "reset=1&action=add&cid={$this->_contactID}&ppid={$paymentsDue['id']}&context=pledge&mode=live" ); } else { $ppUrl = CRM_Utils_System::url( 'civicrm/contact/view/contribution', - "reset=1&action=add&cid={$this->_contactID}&ppid={$payments['id']}&context=pledge" ); + "reset=1&action=add&cid={$this->_contactID}&ppid={$paymentsDue['id']}&context=pledge" ); } CRM_Core_Session::setStatus( ts('This contact has a pending or overdue pledge payment of %2 which is scheduled for %3. Click here to enter a pledge payment.', array( 1 => $ppUrl, 2 => $ppAmountDue, 3 => $ppSchedDate ) ) ); }