Answers.Body: <p>I solved with the patch 5.36.1</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-01T13:40:35.137Z
Answers.LastActivityDate: 2021-10-01T13:40:35.137Z
Answers.UserDisplayName: pk825
Answers.Body: <p>The backtrace is incomplete, but there's enough to see what's happening.</p>
  <p>Someone has customized the code of this site with an &quot;override&quot; - note the line in the backtrace that mentions the file: <code>/home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php</code>.  Overrides are an older technique for customization before extensions existed, and are no longer recommended because of the exact issue you're seeing.</p>
  <p>At some point, someone changed a few lines of code in this file:</p>
  <pre><code>/home/gragorg/public_html/wp-content/plugins/civicrm/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  </code></pre>
  <p>Since every upgrade would overwrite that file, they made a copy here:</p>
  <pre><code>/home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  </code></pre>
  <p>This means the customization isn't overwritten with every upgrade - but if you don't keep that file up to date, you'll eventually run into a place where the old code no longer works with a newer version.</p>
  <p>Because custom code is custom, I can't give a solid recommendation of how to resolve this - but if you have a way of finding out why a customization was introduced, it may not be necessary anymore, and you can delete the override file.</p>
  <p>Note that if you have one override file, you might have others - and each one represents a similar time bomb.  I recommend allocating some time to removing these customizations and/or reimplementing them in extensions.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-21T22:18:29.973Z
Answers.LastActivityDate: 2021-04-21T22:18:29.973Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>This code changed relatively recently, but I can't see how this error would occur without an extension doing something mildly naughty.</p>
  <p>I recommend doing the following and updating your question to reflect the results:</p>
  <ul>
  <li>Turn on <a href="https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/#using-the-built-in-debugging-tools" rel="nofollow noreferrer">backtraces</a> and replicate the error.  You should get more detail.  Post the backtrace as part of your question.  It will help identify a misbehaving extension.</li>
  <li>You can also try replicating the problem on the <a href="https://wpmaster.demo.civicrm.org" rel="nofollow noreferrer">demo site</a> to see if it's a problem specific to your site.  If you can replicate it on the demo site, that will get this escalated very quickly.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-21T16:24:49.543Z
Answers.Text: In the Demo site 5.38 it works without any error and I see that there is another error when there a complete payment in a pay later event (update first message)
Answers.UserDisplayName: pk825
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-21T20:39:59.317Z
Answers.Text: I try in a local copy of the site to remove all extension and also the 5.37beta1 without any success, I think there is something on my data
Answers.UserDisplayName: pk825
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-21T12:53:45.633Z
Answers.LastActivityDate: 2021-04-21T12:53:45.633Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>After upgrading to 5.36, last version, when I try to add membership to an existant contact I received an error</p>
  <blockquote>
  <p>Deprecated: Non-static method CRM_Member_Form::getPriceSetID() should
  not be called statically in
  D:\xampp\htdocs\wp-content\uploads\civicrm\custom_php\CRM\Member\Form\Membership.php
  on line 672</p>
  <p>Fatal error: Uncaught Error: Using $this when not in object context in
  D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Member\Form.php:460
  Stack trace: #0
  D:\xampp\htdocs\wp-content\uploads\civicrm\custom_php\CRM\Member\Form\Membership.php(672):
  CRM_Member_Form::getPriceSetID(Array) #1
  D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\packages\HTML\QuickForm.php(1600):
  CRM_Member_Form_Membership::formRule(Array, Array,
  Object(CRM_Member_Form_Membership)) #2
  D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\Form.php(591):
  HTML_QuickForm-&gt;validate() #3
  D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\QuickForm\Action\Upload.php(136):
  CRM_Core_Form-&gt;validate() #4
  D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\QuickForm\Action\Upload.php(119):
  CRM_Core_QuickForm_Action_Upload-&gt;realPerform(Object(CRM_Member_Form_Membership),
  'upload') #5
  D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\packages\HTML\QuickForm\Controller.php(203):
  CRM_Core_QuickForm_Action_Upload-&gt;perform(Object(CRM_M in
  D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Member\Form.php
  on line 460</p>
  </blockquote>
  <p>The system have Wordpress 5.7 and PHP 7.3
  It works if I use a PriceSet, but I use the standard membership option
  <a href="https://i.sstatic.net/ZJssG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZJssG.png" alt="enter image description here" /></a></p>
  <p>In the Demo site 5.38 it works without any error. I try to set debug mode, but I haven't any other information in the log, just the Wordpress error</p>
  <p>I see that there is another error when there a complete payment in a pay later event:</p>
  <blockquote>
  <p>Notice: Undefined variable:
  CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromEvent
  in
  /home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  on line 2907</p>
  <p>Notice: Undefined index: 53 in
  /home/gragorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Financial/BAO/PaymentProcessor.php
  on line 232</p>
  <p>Warning: Illegal string offset 'contribution' in
  /home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  on line 4382</p>
  <p>Warning: Attempt to assign property 'total_amount' of non-object in
  /home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  on line 2617</p>
  <p>Notice: Undefined index: contribution_recur_id in
  /home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  on line 2634</p>
  <p>Fatal error: Uncaught TypeError: Argument 1 passed to
  CRM_Contribute_BAO_ContributionRecur::getTemplateContribution() must
  be of the type int, null given, called in
  /home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  on line 2636 and defined in
  /home/gragorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionRecur.php:419
  Stack trace: #0
  /home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php(2636):
  CRM_Contribute_BAO_ContributionRecur::getTemplateContribution(NULL,
  Array) #1
  /home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php(4435):
  CRM_Contribute_BAO_Contribution::repeatTransaction('7', Array, Array)
  #2 /home/gragorg/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php(688): CRM_Contribute_BAO_Contribution::completeOrder(Array, NULL, NULL,
  true) #3
  /home/gragorg/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php(502): in
  /home/gragorg/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionRecur.php
  on line 419</p>
  </blockquote>
  <p>I have some doubt about price set values in the DB
  <a href="https://i.sstatic.net/vmoza.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vmoza.png" alt="price set" /></a>
  it seems that there is same record that I don't found the in the interface and the one I see I can't remove because the system tell me that is related to a member or event page. The id 14 in the price_set_entity table is related to the membership page, but I don't find any way to remove this relation.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-04-22T18:22:53.017Z
Comments.Text: Thank you very much, with your suggestion of the custom php I have solved the contribution problem. I have still the membership problem also removing the php custom file (I add the priceset table where it seems there are a dirty value that I could remove and I don't found in the interface)
Comments.UserDisplayName: pk825
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-10T20:05:05.417Z
Comments.Text: Just curious: did you have CiviContribute enabled in the past and disabled it later?
Comments.UserDisplayName: Webmaster COVS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-11T22:51:10.813Z
Comments.Text: This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/11775)
Comments.UserDisplayName: Luke Stewart
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-17T19:48:48.020Z
Comments.Text: I have CiviContributed enabled before, I found that is a problem related to the coma in the field cost (a know bug)
Comments.UserDisplayName: pk825
Tags: <civimember>
Title: Add membership after upgrading to 5.36 error on PriceSet
ThreadText: # Add membership after upgrading to 5.36 error on PriceSet
  
  (Asked by: username_0 on 2021-04-20)
  
  After upgrading to 5.36, last version, when I try to add membership to an existant contact I received an error
  
  > Deprecated: Non-static method CRM\_Member\_Form::getPriceSetID() should
  > not be called statically in
  > D:\xampp\htdocs\wp-content\uploads\civicrm\custom\_php\CRM\Member\Form\Membership.php
  > on line 672
  >
  > Fatal error: Uncaught Error: Using $this when not in object context in
  > D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Member\Form.php:460
  > Stack trace: #0
  > D:\xampp\htdocs\wp-content\uploads\civicrm\custom\_php\CRM\Member\Form\Membership.php(672):
  > CRM\_Member\_Form::getPriceSetID(Array) #1
  > D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\packages\HTML\QuickForm.php(1600):
  > CRM\_Member\_Form\_Membership::formRule(Array, Array,
  > Object(CRM\_Member\_Form\_Membership)) #2
  > D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\Form.php(591):
  > HTML\_QuickForm->validate() #3
  > D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\QuickForm\Action\Upload.php(136):
  > CRM\_Core\_Form->validate() #4
  > D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\QuickForm\Action\Upload.php(119):
  > CRM\_Core\_QuickForm\_Action\_Upload->realPerform(Object(CRM\_Member\_Form\_Membership),
  > 'upload') #5
  > D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\packages\HTML\QuickForm\Controller.php(203):
  > CRM\_Core\_QuickForm\_Action\_Upload->perform(Object(CRM\_M in
  > D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Member\Form.php
  > on line 460
  
  The system have Wordpress 5.7 and PHP 7.3
  It works if I use a PriceSet, but I use the standard membership option
  [![enter image description here](https://i.sstatic.net/ZJssG.png)](https://i.sstatic.net/ZJssG.png)
  
  In the Demo site 5.38 it works without any error. I try to set debug mode, but I haven't any other information in the log, just the Wordpress error
  
  I see that there is another error when there a complete payment in a pay later event:
  
  > Notice: Undefined variable:
  > CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromEvent
  > in
  > /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php
  > on line 2907
  >
  > Notice: Undefined index: 53 in
  > /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Financial/BAO/PaymentProcessor.php
  > on line 232
  >
  > Warning: Illegal string offset 'contribution' in
  > /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php
  > on line 4382
  >
  > Warning: Attempt to assign property 'total\_amount' of non-object in
  > /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php
  > on line 2617
  >
  > Notice: Undefined index: contribution\_recur\_id in
  > /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php
  > on line 2634
  >
  > Fatal error: Uncaught TypeError: Argument 1 passed to
  > CRM\_Contribute\_BAO\_ContributionRecur::getTemplateContribution() must
  > be of the type int, null given, called in
  > /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php
  > on line 2636 and defined in
  > /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionRecur.php:419
  > Stack trace: #0
  > /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php(2636):
  > CRM\_Contribute\_BAO\_ContributionRecur::getTemplateContribution(NULL,
  > Array) #1
  > /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php(4435):
  > CRM\_Contribute\_BAO\_Contribution::repeatTransaction('7', Array, Array)
  > #2 /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php(688): CRM\_Contribute\_BAO\_Contribution::completeOrder(Array, NULL, NULL,
  > true) #3
  > /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php(502): in
  > /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionRecur.php
  > on line 419
  
  I have some doubt about price set values in the DB
  [![price set](https://i.sstatic.net/vmoza.png)](https://i.sstatic.net/vmoza.png)
  it seems that there is same record that I don't found the in the interface and the one I see I can't remove because the system tell me that is related to a member or event page. The id 14 in the price\_set\_entity table is related to the membership page, but I don't find any way to remove this relation.
  
  **Tags:** civimember
  
  > **Comments:**
  > **username_0**: Thank you very much, with your suggestion of the custom php I have solved the contribution problem. I have still the membership problem also removing the php custom file (I add the priceset table where it seems there are a dirty value that I could remove and I don't found in the interface)  
  > **username_1**: Just curious: did you have CiviContribute enabled in the past and disabled it later?  
  > **username_2**: This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/11775)  
  > **username_0**: I have CiviContributed enabled before, I found that is a problem related to the coma in the field cost (a know bug)  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2021-10-01. Score: 0 | Accepted answer
  
  I solved with the patch 5.36.1
  
  
  ---
  
  ### Answer by username_3 on 2021-04-21. Score: 1
  
  The backtrace is incomplete, but there's enough to see what's happening.
  
  Someone has customized the code of this site with an "override" - note the line in the backtrace that mentions the file: `/home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php`. Overrides are an older technique for customization before extensions existed, and are no longer recommended because of the exact issue you're seeing.
  
  At some point, someone changed a few lines of code in this file:
  
  ```
  /home/gragorg/public_html/wp-content/plugins/civicrm/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  
  ```
  
  Since every upgrade would overwrite that file, they made a copy here:
  
  ```
  /home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php
  
  ```
  
  This means the customization isn't overwritten with every upgrade - but if you don't keep that file up to date, you'll eventually run into a place where the old code no longer works with a newer version.
  
  Because custom code is custom, I can't give a solid recommendation of how to resolve this - but if you have a way of finding out why a customization was introduced, it may not be necessary anymore, and you can delete the override file.
  
  Note that if you have one override file, you might have others - and each one represents a similar time bomb. I recommend allocating some time to removing these customizations and/or reimplementing them in extensions.
  
  
  ---
  
  ### Answer by username_3 on 2021-04-21. Score: 0
  
  This code changed relatively recently, but I can't see how this error would occur without an extension doing something mildly naughty.
  
  I recommend doing the following and updating your question to reflect the results:
  
  * Turn on [backtraces](https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/#using-the-built-in-debugging-tools) and replicate the error. You should get more detail. Post the backtrace as part of your question. It will help identify a misbehaving extension.
  * You can also try replicating the problem on the [demo site](https://wpmaster.demo.civicrm.org) to see if it's a problem specific to your site. If you can replicate it on the demo site, that will get this escalated very quickly.
  
  > **Comments:**
  > **username_0**: In the Demo site 5.38 it works without any error and I see that there is another error when there a complete payment in a pay later event (update first message)  
  > **username_0**: I try in a local copy of the site to remove all extension and also the 5.37beta1 without any success, I think there is something on my data  
  
  ---
  
  