1

Our system has 26 different membership type, for 3 different member organization. Since 5.35 Civi upgrade sometimes we are unable to create/update membership from New/Edit backend membership form. We encountered following errors(without priceset)

  1. Please select a membership type (even though membership type is selected).
  2. Unable to add membership for the contact.
  3. Membership field is not updated(like source, join date, custom fields etc) but status message says saved successfully.
  4. Upon submitting new membership says saved successfully but no membership is created.

There are so many scenarios where it fails to create and update membership. However it does work i.e save/update sometimes for some membership types but not for all.

Couldn't replicate the error on dmaster.demo.civicrm.org, may be because we are on older version of Civi? Is this already fixed in latest version of Civi, if so how difficult is it to port the changes to 5.35.2(we don't want to update Civi unless we do thorough testing)?

Any pointers or help really appreciated.

Thanks in advance

Abhi

1 Answer 1

2

Did you recently merge Organization contact which was related to membership type? If yes than its a known error in CiviCRM. I always prefer to retain the contact linked to membership type or settings. Or another option to avoid this in future we have installed an extension on most of our client site.

Solution to fix the problem? Run below query to fix the price set data.

SELECT cpf.id, cpf.name, cmt.member_of_contact_id,  cpfv.membership_type_id
FROM civicrm_price_field cpf 
  INNER JOIN civicrm_price_field_value cpfv 
    ON cpfv.price_field_id = cpf.id 
  INNER JOIN civicrm_price_set cps 
    ON cps.id = cpf.price_set_id AND cps.name = 'default_membership_type_amount'
  INNER JOIN civicrm_membership_type cmt
    ON cmt.id = cpfv.membership_type_id;

-- Incase above query returned results with cpf.name <> cmt.member_of_contact_id than run below query.

UPDATE civicrm_price_field cpf 
  INNER JOIN civicrm_price_field_value cpfv 
    ON cpfv.price_field_id = cpf.id 
  INNER JOIN civicrm_price_set cps 
    ON cps.id = cpf.price_set_id AND cps.name = 'default_membership_type_amount'
  INNER JOIN civicrm_membership_type cmt
    ON cmt.id = cpfv.membership_type_id
SET cpf.name = cmt.member_of_contact_id;

HTH

Pradeep

2
  • Thank you @pradeep, yes we did bulk merge last week. Most of the things you mentioned is over my head, will try to run the mysql command and get back to you soon. Commented May 24, 2021 at 8:12
  • The update sql query fixed the problem, thanks again Commented May 24, 2021 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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