Answers.Body: <p>I'm guessing you aren't using the most recent version of CiviCRM (4.7.27). In the current version of this file, that line has been replaced with:</p>
  
  <pre><code>$args['totalbillingcycles'] = CRM_Utils_Array::value('installments', $params);
  </code></pre>
  
  <p>The CRM_Utils_Array function is meant to prevent missing indices or variables that aren't even arrays from throwing warnings. (<a href="https://issues.civicrm.org/jira/browse/CRM-13288" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-13288</a>).</p>
  
  <p>I have no idea when the change in the code happened (what version/date).</p>
  
  <p>I suggest you upgrade your CiviCRM. It looks like it would be relatively harmless to update the code manually, in this case.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-29T20:37:52.673Z
Answers.LastActivityDate: 2017-11-29T20:37:52.673Z
Answers.UserDisplayName: Michael Collins
Body: <p>We have a contribution page with the option to mark the donation as recurring with the ability to specify the term (how many months). This was working well, until recently, we are receiving a big red notice at the top of the page, even though the contribution appears to have registered correctly with CiviCRM as well as with Paypal. Here's the error:</p>
  
  <p>Notice: Undefined index: installments in CRM_Core_Payment_PayPalImpl->doDirectPayment() (line 371 of /[PATH_TO_CIVI]/crm/sites/all/modules/civicrm/CRM/Core/Payment/PayPalImpl.php).</p>
  
  <p>Any ideas as to what I need to do to make this error/notice go away?</p>
  
  <p>EDIT: I checked line 371 in the file specified and this is the line:</p>
  
  <pre><code> $args['totalbillingcycles'] = $params['installments'];
  </code></pre>
  
  <p>Which exists in the middle of the following If statement starting on line 356:</p>
  
  <pre><code>if (CRM_Utils_Array::value('is_recur', $params) == 1) {
        $start_time = strtotime(date('m/d/Y'));
        $start_date = date('Y-m-d\T00:00:00\Z', $start_time);
  
        $args['PaymentAction'] = 'Sale';
        $args['billingperiod'] = ucwords($params['frequency_unit']);
        $args['billingfrequency'] = $params['frequency_interval'];
        $args['method'] = "CreateRecurringPaymentsProfile";
        $args['profilestartdate'] = $start_date;
        $args['desc'] = "" .
          $params['description'] . ": " .
          $params['amount'] . " Per " .
          $params['frequency_interval'] . " " .
          $params['frequency_unit'];
        $args['amt'] = $params['amount'];
        $args['totalbillingcycles'] = $params['installments'];
        $args['version'] = 56.0;
        $args['PROFILEREFERENCE'] = "" .
          "i=" . $params['invoiceID'] . "&amp;m=" . $component .
          "&amp;c=" . $params['contactID'] . "&amp;r=" . $params['contributionRecurID'] .
          "&amp;b=" . $params['contributionID'] . "&amp;p=" . $params['contributionPageID'];
      }
  </code></pre>
  
  <p>Any thoughts?</p>
  
Tags: <recurring-contributions>
Title: Recurring contributions on paypal pro - undefined index
ThreadText: # Recurring contributions on paypal pro - undefined index
  
  (Asked by: username_0 on 2017-11-29)
  
  We have a contribution page with the option to mark the donation as recurring with the ability to specify the term (how many months). This was working well, until recently, we are receiving a big red notice at the top of the page, even though the contribution appears to have registered correctly with CiviCRM as well as with Paypal. Here's the error:
  Notice: Undefined index: installments in CRM_Core_Payment_PayPalImpl->doDirectPayment() (line 371 of /[PATH_TO_CIVI]/crm/sites/all/modules/civicrm/CRM/Core/Payment/PayPalImpl.php).
  Any ideas as to what I need to do to make this error/notice go away?
  EDIT: I checked line 371 in the file specified and this is the line:
   $args['totalbillingcycles'] = $params['installments'];
  
  Which exists in the middle of the following If statement starting on line 356:
  if (CRM_Utils_Array::value('is_recur', $params) == 1) {
        $start_time = strtotime(date('m/d/Y'));
        $start_date = date('Y-m-d\T00:00:00\Z', $start_time);
  
        $args['PaymentAction'] = 'Sale';
        $args['billingperiod'] = ucwords($params['frequency_unit']);
        $args['billingfrequency'] = $params['frequency_interval'];
        $args['method'] = "CreateRecurringPaymentsProfile";
        $args['profilestartdate'] = $start_date;
        $args['desc'] = "" .
          $params['description'] . ": " .
          $params['amount'] . " Per " .
          $params['frequency_interval'] . " " .
          $params['frequency_unit'];
        $args['amt'] = $params['amount'];
        $args['totalbillingcycles'] = $params['installments'];
        $args['version'] = 56.0;
        $args['PROFILEREFERENCE'] = "" .
          "i=" . $params['invoiceID'] . "&m=" . $component .
          "&c=" . $params['contactID'] . "&r=" . $params['contributionRecurID'] .
          "&b=" . $params['contributionID'] . "&p=" . $params['contributionPageID'];
      }
  
  Any thoughts?
  
  **Tags:** recurring-contributions
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-11-29. Score: 1
  
  I'm guessing you aren't using the most recent version of CiviCRM (4.7.27). In the current version of this file, that line has been replaced with:
  $args['totalbillingcycles'] = CRM_Utils_Array::value('installments', $params);
  
  The CRM_Utils_Array function is meant to prevent missing indices or variables that aren't even arrays from throwing warnings. (https://issues.civicrm.org/jira/browse/CRM-13288).
  I have no idea when the change in the code happened (what version/date).
  I suggest you upgrade your CiviCRM. It looks like it would be relatively harmless to update the code manually, in this case.
  
  
  ---
  
  