Answers.Body: <p>I am not sure how this happened but <em>Partially paid</em> and <em>Pending refund</em> where added with the values of 1 and 2 respectfully.  These  were duplicating the completed statuses like you can see in this image.  </p>
  
  <p>[<img src="https://i.sstatic.net/3uPmW.png" alt="enter image description here"></p>
  
  <p>I have also updated the JIRA ticket <a href="https://issues.civicrm.org/jira/browse/CRM-20523" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-20523</a>.  </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-14T21:51:06.450Z
Answers.Text: These are the queries I used to fix this. 
  
  mysql> UPDATE civicrm_option_value SET is_active ='1' WHERE id='1' and option_group_id='11';
  Query OK, 0 rows affected (0.00 sec)
  Rows matched: 0  Changed: 0  Warnings: 0
  
  mysql> UPDATE civicrm_option_value SET is_active ='1' WHERE value='1' and option_group_id='11';
  Query OK, 1 row affected (0.01 sec)
  Rows matched: 1  Changed: 1  Warnings: 0
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-03T09:57:03.620Z
Answers.Text: Interesting .. where are you seeing the screenshot you took ?
Answers.UserDisplayName: commonpike
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-14T21:50:21.543Z
Answers.LastActivityDate: 2017-05-14T21:50:21.543Z
Answers.UserDisplayName: Josh
Answers.Body: <p>It does look like the API is called in the background anyway. That would make sense as it is the preferred way to communicate with the database. It does look like the API action 'getsingle' is used and it is receiving more than one. Can you explain a little more on which point you are getting the error?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T17:19:55.637Z
Answers.Text: The error comes when confirming the submission of a payment using the CiviCRM event pages.  Thanks!
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T17:20:57.330Z
Answers.Text: On some of my tests I am seeing Notice: Undefined index: trxn_id in CRM_Event_Form_Registration_Confirm::processContribution() (line 985 of /home/site/public_html/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php). right before the fatal error.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T17:27:48.420Z
Answers.Text: That might be the cause of the problem? I can not say from a distance :-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T20:08:24.153Z
Answers.Text: how would I go about figuring out how that happening? This was all working great in 4.6 and I do not have any extensions acting on these pages. To Veriffy this I turned off all the extensions and still get the error. :(
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-01T00:46:03.443Z
Answers.Text: I think I found the problem the *Completed*  status appears to be missing.  For example, when creating a contribution in the back end as part of an event registration I see this  - https://s3-us-west-2.amazonaws.com/onlinesharing18/Screen+Shot+2017-04-30+at+6.38.10+PM.png . None of the new transactions that have gone through have a completed status  (https://s3-us-west-2.amazonaws.com/onlinesharing18/Screen+Shot+2017-04-30+at+6.43.07+PM.png).  If I look at the contribution_status options it is there and endabled.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-01T12:20:18.413Z
Answers.Text: That would make sense. Have you added the Completed status?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-01T16:25:47.507Z
Answers.Text: The completed status exists in the system but is not available when working with contributions.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-02T06:26:20.563Z
Answers.Text: That is strange, what is the status? It should have is_active = 1?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-02T15:08:48.527Z
Answers.Text: Yes, it is set to is_active = '1' (https://s3-us-west-2.amazonaws.com/onlinesharing18/Screen+Shot+2017-05-02+at+9.01.17+AM.png).  I even tried toggling it with a query.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-02T15:37:07.373Z
Answers.Text: Beats me, sounds like an issue with your payment_processor communicating with CivICRM....and I have never worked with one. All Europeans I work with use SEPA :-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T09:53:31.800Z
Answers.LastActivityDate: 2017-04-30T09:53:31.800Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>After upgrading from CiviCRM 4.6.24 to CiviCRM 4.7.18 on Drupal (7.52) we are getting the error "Expected one Contribution but found 25"  whenever registering for an event with an event page.  </p>
  
  <p>I have tested logged in, not logged in,  with and without price sets.  </p>
  
  <p>The transactions receiving this error are being created in CiviCRM and not using an API call like with Webform. </p>
  
  <p>I am running Apache 2.4.25 with PHP 5.6.30.</p>
  
  <p>The error details that I have in Drupal Watchdog is too long to post.  </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-02T00:06:28.220Z
Comments.Text: Might be worth looking at [CRM-20297](https://issues.civicrm.org/jira/browse/CRM-20297) and [CRM-20383](https://issues.civicrm.org/jira/browse/CRM-20383) - not confident these are related, but they *may* be.
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-02T00:37:21.877Z
Comments.Text: @ChrisBurgess I looked at both of those and they appear to only be related to transactions that are made with tools outside of CiviCRM. These are the core CiviCRM pages which I see now do use the API.
Comments.UserDisplayName: Josh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-04T01:15:28.253Z
Comments.Text: @ChrisBurgess I applied these patches and unfortunately they did not solve the problem.
Comments.UserDisplayName: Josh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-04T22:03:47.620Z
Comments.Text: I have posted this on the issues.civicrm.org as I think this is a bug. https://issues.civicrm.org/jira/browse/CRM-20523?filter=-2
Comments.UserDisplayName: Josh
Tags: <civievent><civicontribute><4.7>
Title: "Expected one Contribution but found 25"
ThreadText: # "Expected one Contribution but found 25"
  
  (Asked by: username_0 on 2017-04-30)
  
  After upgrading from CiviCRM 4.6.24 to CiviCRM 4.7.18 on Drupal (7.52) we are getting the error "Expected one Contribution but found 25" whenever registering for an event with an event page.
  
  I have tested logged in, not logged in, with and without price sets.
  
  The transactions receiving this error are being created in CiviCRM and not using an API call like with Webform.
  
  I am running Apache 2.4.25 with PHP 5.6.30.
  
  The error details that I have in Drupal Watchdog is too long to post.
  
  **Tags:** civievent, civicontribute, 4.7
  
  > **Comments:**
  > **username_1**: Might be worth looking at [CRM-20297](https://issues.civicrm.org/jira/browse/CRM-20297) and [CRM-20383](https://issues.civicrm.org/jira/browse/CRM-20383) - not confident these are related, but they *may* be.  
  > **username_0**: @ChrisBurgess I looked at both of those and they appear to only be related to transactions that are made with tools outside of CiviCRM. These are the core CiviCRM pages which I see now do use the API.  
  > **username_0**: @ChrisBurgess I applied these patches and unfortunately they did not solve the problem.  
  > **username_0**: I have posted this on the issues.civicrm.org as I think this is a bug. https://issues.civicrm.org/jira/browse/CRM-20523?filter=-2  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-05-14. Score: 1
  
  I am not sure how this happened but *Partially paid* and *Pending refund* where added with the values of 1 and 2 respectfully. These were duplicating the completed statuses like you can see in this image.
  
  [![enter image description here](https://i.sstatic.net/3uPmW.png)
  
  I have also updated the JIRA ticket <https://issues.civicrm.org/jira/browse/CRM-20523>.
  
  > **Comments:**
  > **username_0**: These are the queries I used to fix this.   mysql> UPDATE civicrm_option_value SET is_active ='1' WHERE id='1' and option_group_id='11'; Query OK, 0 rows affected (0.00 sec) Rows matched: 0  Changed: 0  Warnings: 0  mysql> UPDATE civicrm_option_value SET is_active ='1' WHERE value='1' and option_group_id='11'; Query OK, 1 row affected (0.01 sec) Rows matched: 1  Changed: 1  Warnings: 0  
  > **username_2**: Interesting .. where are you seeing the screenshot you took ?  
  
  ---
  
  ### Answer by username_3 on 2017-04-30. Score: 1
  
  It does look like the API is called in the background anyway. That would make sense as it is the preferred way to communicate with the database. It does look like the API action 'getsingle' is used and it is receiving more than one. Can you explain a little more on which point you are getting the error?
  
  > **Comments:**
  > **username_0**: The error comes when confirming the submission of a payment using the CiviCRM event pages.  Thanks!  
  > **username_0**: On some of my tests I am seeing Notice: Undefined index: trxn_id in CRM_Event_Form_Registration_Confirm::processContribution() (line 985 of /home/site/public_html/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php). right before the fatal error.  
  > **username_3**: That might be the cause of the problem? I can not say from a distance :-)  
  > **username_0**: how would I go about figuring out how that happening? This was all working great in 4.6 and I do not have any extensions acting on these pages. To Veriffy this I turned off all the extensions and still get the error. :(  
  > **username_0**: I think I found the problem the *Completed*  status appears to be missing.  For example, when creating a contribution in the back end as part of an event registration I see this  - https://s3-us-west-2.amazonaws.com/onlinesharing18/Screen+Shot+2017-04-30+at+6.38.10+PM.png . None of the new transactions that have gone through have a completed status  (https://s3-us-west-2.amazonaws.com/onlinesharing18/Screen+Shot+2017-04-30+at+6.43.07+PM.png).  If I look at the contribution_status options it is there and endabled.  
  > **username_3**: That would make sense. Have you added the Completed status?  
  > **username_0**: The completed status exists in the system but is not available when working with contributions.  
  > **username_3**: That is strange, what is the status? It should have is_active = 1?  
  > **username_0**: Yes, it is set to is_active = '1' (https://s3-us-west-2.amazonaws.com/onlinesharing18/Screen+Shot+2017-05-02+at+9.01.17+AM.png).  I even tried toggling it with a query.  
  > **username_3**: Beats me, sounds like an issue with your payment_processor communicating with CivICRM....and I have never worked with one. All Europeans I work with use SEPA :-)  
  
  ---
  
  