1

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

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 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.

1
  • 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)
    – pk825
    Apr 22 at 18:22
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.

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 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 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.
2
  • 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)
    – pk825
    Apr 21 at 16:24
  • 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
    – pk825
    Apr 21 at 20:39
0

I solved with the patch 5.36.1

0

Just curious: did you have CiviContribute enabled in the past and disabled it later?

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 Nov 11 at 22:51
  • I have CiviContributed enabled before, I found that is a problem related to the coma in the field cost (a know bug)
    – pk825
    Nov 17 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.