Answers.Body: <p>This is a core bug and have submitted a fix for it. Can you please try applying patch from <a href="https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/14237.patch" rel="nofollow noreferrer">here</a>. If it works for you than please add a comment on <a href="https://github.com/civicrm/civicrm-core/pull/14237" rel="nofollow noreferrer">PR</a>.</p>
  
  <p>Cheers</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-13T17:34:21.643Z
Answers.Text: Thanks for this, I should be able to test later today.
Answers.UserDisplayName: freeform.steph
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-17T00:31:02.457Z
Answers.Text: I've added my comments on the PR, almost there. Thanks again.
Answers.UserDisplayName: freeform.steph
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-11T09:33:09.657Z
Answers.LastActivityDate: 2019-05-11T09:33:09.657Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Issue: After disabling an event price set field option that one or more participants had already selected in their registration, you are now unable to run the custom search "Price Set Details for Event Participants". </p>
  
  <p>This has been an issue since 4.6 (at least), and reproduced today on the demo site (civicrm.demo.civihosting.com running 5.10.0), as well as the sandbox site (dmaster.demo.civicrm.org running 5.15.alpha1).</p>
  
  <p>When might this happen? You've begun registration for an event, but due to lack of registrations or unforeseen circumstances, you need to cancel one the available options. You issue refunds to anyone who has already paid (not required to reproduce error), and disable the option so that no one else selects it. </p>
  
  <p>How to reproduce:</p>
  
  <ul>
  <li>Create an event price set, with a radio field with a couple of options (example: workshop 1, workshop 2)</li>
  <li>Create an event and choose your price set</li>
  <li>Register an event participant and select one of the price field options</li>
  <li>Go to <em>Search > Custom Searches > Price Set Details for Event Participants</em> and get results for your event, all should be good</li>
  <li>Edit the price field and disable the price field option your registrant selected</li>
  <li>Repeat the Price Set search, you will now get an error</li>
  </ul>
  
  <blockquote>
    <p>DB Error: no such field</p>
  </blockquote>
  
  <pre><code>Further detail in ConfigAndLog file:
  
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; handle
          )
  
      [code] =&gt; -19
      [message] =&gt; DB Error: no such field
      [mode] =&gt; 16
      [debug_info] =&gt; 
  UPDATE civicrm_temp_custom_06a7d4ad3c362837ef807a1493c88112
  SET price_field_271 = 1.00,price_field_284 = 0.00,price_field_289 = 0.00,price_field_306 = 1.00,price_field_307 = 1.00
  WHERE participant_id = 1562;
   [nativecode=1054 ** Unknown column 'price_field_289' in 'field list']
      [type] =&gt; DB_Error
      [user_info] =&gt; 
  UPDATE civicrm_temp_custom_06a7d4ad3c362837ef807a1493c88112
  SET price_field_271 = 1.00,price_field_284 = 0.00,price_field_289 = 0.00,price_field_306 = 1.00,price_field_307 = 1.00
  WHERE participant_id = 1562;
   [nativecode=1054 ** Unknown column 'price_field_289' in 'field list']
      [to_string] =&gt; [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="
  UPDATE civicrm_temp_custom_06a7d4ad3c362837ef807a1493c88112
  SET price_field_271 = 1.00,price_field_284 = 0.00,price_field_289 = 0.00,price_field_306 = 1.00,price_field_307 = 1.00
  WHERE participant_id = 1562;
   [nativecode=1054 ** Unknown column 'price_field_289' in 'field list']"]
  )
  </code></pre>
  
  <p>You'll find with investigation that the participant in question is the one registered, and the "Unknown column 'price_field_[id]'" will be the price option that you disabled.</p>
  
  <p>The likely file to be updated is CRM/Contact/Form/Search/Custom/PriceSet.php</p>
  
  <p>Workaround: temporarily reenable the option, run the report, disable the option again.</p>
  
Tags: <civievent><price-sets><custom-search>
Title: Unable to use Price Set Details for Event Participants custom search if price set field option is disabled after a registrant has already selected it
ThreadText: # Unable to use Price Set Details for Event Participants custom search if price set field option is disabled after a registrant has already selected it
  
  (Asked by: username_0 on 2019-05-10)
  
  Issue: After disabling an event price set field option that one or more participants had already selected in their registration, you are now unable to run the custom search "Price Set Details for Event Participants".
  
  This has been an issue since 4.6 (at least), and reproduced today on the demo site (civicrm.demo.civihosting.com running 5.10.0), as well as the sandbox site (dmaster.demo.civicrm.org running 5.15.alpha1).
  
  When might this happen? You've begun registration for an event, but due to lack of registrations or unforeseen circumstances, you need to cancel one the available options. You issue refunds to anyone who has already paid (not required to reproduce error), and disable the option so that no one else selects it.
  
  How to reproduce:
  
  * Create an event price set, with a radio field with a couple of options (example: workshop 1, workshop 2)
  * Create an event and choose your price set
  * Register an event participant and select one of the price field options
  * Go to *Search > Custom Searches > Price Set Details for Event Participants* and get results for your event, all should be good
  * Edit the price field and disable the price field option your registrant selected
  * Repeat the Price Set search, you will now get an error
  
  > DB Error: no such field
  
  ```
  Further detail in ConfigAndLog file:
  
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => handle
          )
  
      [code] => -19
      [message] => DB Error: no such field
      [mode] => 16
      [debug_info] => 
  UPDATE civicrm_temp_custom_06a7d4ad3c362837ef807a1493c88112
  SET price_field_271 = 1.00,price_field_284 = 0.00,price_field_289 = 0.00,price_field_306 = 1.00,price_field_307 = 1.00
  WHERE participant_id = 1562;
   [nativecode=1054 ** Unknown column 'price_field_289' in 'field list']
      [type] => DB_Error
      [user_info] => 
  UPDATE civicrm_temp_custom_06a7d4ad3c362837ef807a1493c88112
  SET price_field_271 = 1.00,price_field_284 = 0.00,price_field_289 = 0.00,price_field_306 = 1.00,price_field_307 = 1.00
  WHERE participant_id = 1562;
   [nativecode=1054 ** Unknown column 'price_field_289' in 'field list']
      [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="
  UPDATE civicrm_temp_custom_06a7d4ad3c362837ef807a1493c88112
  SET price_field_271 = 1.00,price_field_284 = 0.00,price_field_289 = 0.00,price_field_306 = 1.00,price_field_307 = 1.00
  WHERE participant_id = 1562;
   [nativecode=1054 ** Unknown column 'price_field_289' in 'field list']"]
  )
  
  ```
  
  You'll find with investigation that the participant in question is the one registered, and the "Unknown column 'price\_field\_[id]'" will be the price option that you disabled.
  
  The likely file to be updated is CRM/Contact/Form/Search/Custom/PriceSet.php
  
  Workaround: temporarily reenable the option, run the report, disable the option again.
  
  **Tags:** civievent, price-sets, custom-search
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-11. Score: 0
  
  This is a core bug and have submitted a fix for it. Can you please try applying patch from [here](https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/14237.patch). If it works for you than please add a comment on [PR](https://github.com/civicrm/civicrm-core/pull/14237).
  
  Cheers
  
  username_1
  
  > **Comments:**
  > **username_0**: Thanks for this, I should be able to test later today.  
  > **username_0**: I've added my comments on the PR, almost there. Thanks again.  
  
  ---
  
  