CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • How to resolve upgrade issue caused by multiple membership price sets?
Pages: [1]

Author Topic: How to resolve upgrade issue caused by multiple membership price sets?  (Read 1000 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
How to resolve upgrade issue caused by multiple membership price sets?
September 25, 2012, 08:09:40 am
An infrequent use case was not upgraded properly in 4.2.0 and 4.2.1. If your site had more than one membership price set, then extraneous line items were inserted into contributions using those price sets during the upgrade, one for each price set beyond the first.

You can fix this problem by running the following SQL query either in phpMyAdmin on a SQL tab window or from a MySQL command line. If you are doing an upgrade and don't have access to either of these methods, then you might want to get help in the IRC channel, or post a question here in the forum.

Make sure you have a backup of your site and its databases before proceeding.

Code: [Select]
DELETE cli.* FROM `civicrm_line_item` cli
INNER JOIN civicrm_membership_payment cmp ON cmp.contribution_id = cli.entity_id AND cli.entity_table = 'civicrm_contribution'
INNER JOIN civicrm_price_field_value cpfv ON cpfv.id = cli.price_field_value_id
INNER JOIN civicrm_price_field cpf ON cpf.id = cpfv.price_field_id and cpf.id != cli.price_field_id
INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <> 'default_membership_type_amount'

If you were attempting an upgrade to 4.2.2+ and were referred by an upgrade warning message to this post, then after running this query:
  • please take another backup of your site and
  • begin your upgrade again.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • How to resolve upgrade issue caused by multiple membership price sets?

This forum was archived on 2017-11-26.