Body: <p>I have created a webform with a single contact and am using it to renew a membership. The process appears to complete successfully however when I look at the contribution in the contact's record I can edit the contribution but if I try to 'view' the contribution I get an error:</p>
  <pre><code>Unable to reach the server. Please refresh this page in your browser and try again.
  </code></pre>
  <p>If I try to view the contribution in the webform results I get this error:</p>
  <blockquote>
  <p>CiviCRM_API3_Exception: &quot;Expected one PriceSet but found 25&quot;</p>
  </blockquote>
  <pre><code>#0 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php(158): civicrm_api3(&quot;PriceSet&quot;, &quot;getsingle&quot;, (Array:2))
  #1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php(531): CRM_Contribute_Form_ContributionView-&gt;preProcess()
  #2 /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form-&gt;buildForm()
  #3 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display-&gt;perform(Object(CRM_Contribute_Form_ContributionView), &quot;display&quot;)
  #4 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller-&gt;handle(Object(CRM_Contribute_Form_ContributionView), &quot;display&quot;)
  #5 /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page-&gt;handle(&quot;display&quot;)
  #6 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php(214): CRM_Core_Controller-&gt;run()
  #7 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php(286): CRM_Contribute_Page_Tab-&gt;view()
  #8 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(310): CRM_Contribute_Page_Tab-&gt;run((Array:4), NULL)
  #9 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  #10 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
  #11 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
  #12 [internal function](): civicrm_invoke(&quot;contact&quot;, &quot;view&quot;, &quot;contribution&quot;)
  #13 /var/www/html/includes/menu.inc(527): call_user_func_array(&quot;civicrm_invoke&quot;, (Array:3))
  #14 /var/www/html/index.php(20): menu_execute_active_handler()
  #15 {main}
  </code></pre>
  <blockquote>
  <p>Updated with backtrace
  $backTrace = #0</p>
  </blockquote>
  <h1>0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(451): CRM_Core_Error::backtrace(&quot;backTrace&quot;, TRUE)</h1>
  <h1>1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(55): CRM_Core_Error::handleUnhandledException(Object(CiviCRM_API3_Exception))</h1>
  <h1>2 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))</h1>
  <h1>3 internal function: civicrm_invoke(&quot;contact&quot;, &quot;view&quot;, &quot;contribution&quot;)</h1>
  <h1>4 /var/www/html/includes/menu.inc(527): call_user_func_array(&quot;civicrm_invoke&quot;, (Array:3))</h1>
  <h1>5 /var/www/html/index.php(20): menu_execute_active_handler()</h1>
  <h1>6 {main}</h1>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-23T14:34:01.437Z
Comments.Text: I suppose you are using webform_civicrm. This drupal module does not support price sets (See the documentation https://wiki.civicrm.org/confluence/display/CRMDOC/Webform+CiviCRM+Integration). When your contribution page does, this is maybe the source of the problem.
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-23T20:26:47.700Z
Comments.Text: Yes - I have created a contribution page with the minimal information (the documentation varies from the help displayed online - one says you need to check Contribution Amounts with Label and allow Other Payments, but either way it results in the same outcome). In the database the Contibution record looks OK and in the Line Item table the record looks OK. But when I view the Contribution from the contact record list of contributions I get a "Network Error - Unable to reach the server".
  
  I am not sure how I can further diagnose the cause of the error.
Comments.UserDisplayName: Martin Fuggle
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-24T00:20:56.387Z
Comments.Text: I can create a membership using a webform when logged on as user1 and also when logged in as user2. When I log out and login as the admin user I can then view the contributions for both user1 and user2. User1 displays the contribution but when I view the contribution for user2 it displays a Network Error - Unable to reach server. What on earth is going on here?
Comments.UserDisplayName: Martin Fuggle
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-25T21:08:09.813Z
Comments.Text: Hi Martin, this error has the same cause as http://civicrm.stackexchange.com/questions/16845/network-error-when-trying-to-view-a-contribution. So you can apply the same strategy.
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-26T03:56:18.407Z
Comments.Text: Hi Kainuk, Thanks so much. I have been bashing my head against a brick wall for a few days now trying every possible configuration combination. Unfortunately I am not a coding expert so I am glad that I am not the only one who has experienced the problem and there is now light at the end of the tunnel! Once again thanks...
Comments.UserDisplayName: Martin Fuggle
Tags: <webform-civicrm><contributions>
Title: Webform created contribution error
ThreadText: # Webform created contribution error
  
  (Asked by: username_0 on 2017-01-23)
  
  I have created a webform with a single contact and am using it to renew a membership. The process appears to complete successfully however when I look at the contribution in the contact's record I can edit the contribution but if I try to 'view' the contribution I get an error:
  Unable to reach the server. Please refresh this page in your browser and try again.
  
  If I try to view the contribution in the webform results I get this error:
  
  CiviCRM_API3_Exception: "Expected one PriceSet but found 25"
  
  #0 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php(158): civicrm_api3("PriceSet", "getsingle", (Array:2))
  #1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php(531): CRM_Contribute_Form_ContributionView->preProcess()
  #2 /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
  #3 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contribute_Form_ContributionView), "display")
  #4 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_ContributionView), "display")
  #5 /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
  #6 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php(214): CRM_Core_Controller->run()
  #7 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php(286): CRM_Contribute_Page_Tab->view()
  #8 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(310): CRM_Contribute_Page_Tab->run((Array:4), NULL)
  #9 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  #10 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
  #11 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
  #12 [internal function](): civicrm_invoke("contact", "view", "contribution")
  #13 /var/www/html/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
  #14 /var/www/html/index.php(20): menu_execute_active_handler()
  #15 {main}
  
  
  Updated with backtrace
  $backTrace = #0
  
  0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(451): CRM_Core_Error::backtrace("backTrace", TRUE)
  1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(55): CRM_Core_Error::handleUnhandledException(Object(CiviCRM_API3_Exception))
  2 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
  3 internal function: civicrm_invoke("contact", "view", "contribution")
  4 /var/www/html/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
  5 /var/www/html/index.php(20): menu_execute_active_handler()
  6 {main}
  
  **Tags:** webform-civicrm, contributions
  
  > **Comments:**
  > **username_1**: I suppose you are using webform_civicrm. This drupal module does not support price sets (See the documentation https://wiki.civicrm.org/confluence/display/CRMDOC/Webform+CiviCRM+Integration). When your contribution page does, this is maybe the source of the problem.  
  > **username_0**: Yes - I have created a contribution page with the minimal information (the documentation varies from the help displayed online - one says you need to check Contribution Amounts with Label and allow Other Payments, but either way it results in the same outcome). In the database the Contibution record looks OK and in the Line Item table the record looks OK. But when I view the Contribution from the contact record list of contributions I get a "Network Error - Unable to reach the server".  I am not sure how I can further diagnose the cause of the error.  
  > **username_0**: I can create a membership using a webform when logged on as user1 and also when logged in as user2. When I log out and login as the admin user I can then view the contributions for both user1 and user2. User1 displays the contribution but when I view the contribution for user2 it displays a Network Error - Unable to reach server. What on earth is going on here?  
  > **username_1**: Hi Martin, this error has the same cause as http://civicrm.stackexchange.com/questions/16845/network-error-when-trying-to-view-a-contribution. So you can apply the same strategy.  
  > **username_0**: Hi Kainuk, Thanks so much. I have been bashing my head against a brick wall for a few days now trying every possible configuration combination. Unfortunately I am not a coding expert so I am glad that I am not the only one who has experienced the problem and there is now light at the end of the tunnel! Once again thanks...  
  
  ---
  
  ## 0 answers
  
  