Membership - archive issueshttps://lab.civicrm.org/dev/membership/-/issues2022-04-22T16:17:37Zhttps://lab.civicrm.org/dev/membership/-/issues/30Membership status does not get updated during membership import when status o...2022-04-22T16:17:37ZandrewcormickdockeryMembership status does not get updated during membership import when status override is setMembership statuses are not updated during import to a non-rule based status even when status override is set.
To reproduce:
1. Use Memberships/Import Memberships to import a CSV file (example below)
2. Choose Contact Type individual, ...Membership statuses are not updated during import to a non-rule based status even when status override is set.
To reproduce:
1. Use Memberships/Import Memberships to import a CSV file (example below)
2. Choose Contact Type individual, Update existing memberships
3. When choosing a field mapping, make sure to match on Membership ID, Membership Type and Membership Start Date
4. Import file should contain columns for Membership Status and Membership Status Override (in the example below, I chose a non-rule based status "Deceased" plus Membership Status Override of 1)
5. Start import. Import indicates success on the screen.
6. Check records. Note that Membership Status Override is set correctly, however the Membership Status remains at the rule-based status and is not changed to the indicated non-rule status.
Example CSV:
```
Membership ID,Member Since,Membership Start Date,Membership Type,Membership Status,Status Override,First Name,Last Name
1,2016-09-11,2016-09-11,General,Deceased,1,Iris,Lee
3,2016-09-09,2016-09-09,General,Deceased,1,Lincoln,Zope
7,2016-09-05,2016-09-05,General,Deceased,1,Ray,Jones
9,2016-09-03,2016-09-03,General,Deceased,1,Nicole,Ivanov
```
We have noticed this regression in the following Civi versions 5.28.3, 5.29.1 and 5.31.beta1. It was working as expected in Civi version 5.24.3.5.31.0https://lab.civicrm.org/dev/membership/-/issues/21Updating Membership details fails if created via Relationship2022-04-22T16:17:26ZTony Maynard-SmithUpdating Membership details fails if created via RelationshipI have a configuration using Household Contacts, and Individuals who are linked to Households by 'Member of'/'Household of' Relationships. The Household holds a Membership which flows down to the Individuals. A Membership sign-up or re...I have a configuration using Household Contacts, and Individuals who are linked to Households by 'Member of'/'Household of' Relationships. The Household holds a Membership which flows down to the Individuals. A Membership sign-up or renewal is done by a logged-in Individual and generates a Contribution attached to this Individual, though the associated master Membership is attached to the Household. This is all set up using a Webform.
Since installing CiviCRM 5.20.0, whenever a Membership is updated one or other of the Memberships in this structure vanishes. Previously on CiviCRM 5.19.3 it worked correctly.
If one of the dates on the Household Membership is changed through the CiviCRM Administrative Interface then:
- The Household Membership vanishes.
- The associated Individual Membership IS updated with the new date, and appears now to be freestanding belonging to the Member.
If the Membership is renewed through the Webform:
- The Household Membership is updated correctly and remains.
- The Membership attached to the Individual Contact vanishes.
- The Contribution which created the Household's Membership remains.
This renders 5.20 unusable as far as we are concerned.
Tonyhttps://lab.civicrm.org/dev/membership/-/issues/16[regression] can't create recurring memberships from membership tab w/ credit...2022-04-22T16:16:58ZJonGold[regression] can't create recurring memberships from membership tab w/ credit card### To replicate
* Create a new recurring membership via the "Submit Credit Card Membership" button on the membership tab.
When you do so, the Contribution and ContributionRecur will be created, but the membership will fail to be create...### To replicate
* Create a new recurring membership via the "Submit Credit Card Membership" button on the membership tab.
When you do so, the Contribution and ContributionRecur will be created, but the membership will fail to be created.
This happens on 5.17.0 to 5.17.4. It does NOT happen on 5.16.4. It appears to be related to [PR 14887](https://github.com/civicrm/civicrm-core/pull/14887). I'm executing [this block of code](https://github.com/civicrm/civicrm-core/blob/82ce7f0bcf49d3ee47f158024c124cce0872beba/CRM/Member/BAO/Membership.php#L379-L396) which means that my `$ids['contribution']` is empty.
Backtrace:
```
Sep 19 15:43:13 [info] $Fatal Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -5
[message] => DB Error: already exists
[mode] => 16
[debug_info] => INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , price_field_id , label , qty , unit_price , line_total , price_field_value_id , financial_type_id ) VALUES ('civicrm_membership' , 49212 , 68001 , 2 , 'Under $5,000 (monthly recurring)' , 1 , 1 , 1 , 12 , 7 ) [nativecode=1062 ** Duplicate entry 'civicrm_membership-49212-68001-12-2' for key 'UI_line_item_value']
[type] => DB_Error
[user_info] => INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , price_field_id , label , qty , unit_price , line_total , price_field_value_id , financial_type_id ) VALUES ('civicrm_membership' , 49212 , 68001 , 2 , 'Under $5,000 (monthly recurring)' , 1 , 1 , 1 , 12 , 7 ) [nativecode=1062 ** Duplicate entry 'civicrm_membership-49212-68001-12-2' for key 'UI_line_item_value']
[to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , price_field_id , label , qty , unit_price , line_total , price_field_value_id , financial_type_id ) VALUES ('civicrm_membership' , 49212 , 68001 , 2 , 'Under $5,000 (monthly recurring)' , 1 , 1 , 1 , 12 , 7 ) [nativecode=1062 ** Duplicate entry 'civicrm_membership-49212-68001-12-2' for key 'UI_line_item_value']"]
)
Sep 19 15:43:13 [info] $backTrace = #0 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(236): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/DB.php(987): PEAR_Error->__construct("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , p...")
#3 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-5, 16, (Array:2), "INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , p...")
#4 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -5, 16, (Array:2), "INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , p...", "DB_Error", TRUE)
#5 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1920): PEAR->__call("raiseError", (Array:7))
#6 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-5, NULL, NULL, "INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , p...", "1062 ** Duplicate entry 'civicrm_membership-49212-68001-12-2' for key 'UI_lin...")
#7 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1229): DB_mysqli->simpleQuery("INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , p...")
#9 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query("INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , p...")
#10 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1040): DB_DataObject->_query("INSERT INTO civicrm_line_item (entity_table , entity_id , contribution_id , p...")
#11 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(572): DB_DataObject->insert()
#12 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Price/BAO/LineItem.php(86): CRM_Core_DAO->save()
#13 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Price/BAO/LineItem.php(471): CRM_Price_BAO_LineItem::create((Array:11))
#14 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(400): CRM_Price_BAO_LineItem::processPriceSet(49212, (Array:1), Object(CRM_Contribute_BAO_Contribution))
#15 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Member/Form/Membership.php(1526): CRM_Member_BAO_Membership::create((Array:43), (Array:1))
#16 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Member/Form/Membership.php(927): CRM_Member_Form_Membership->submit()
#17 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(495): CRM_Member_Form_Membership->postProcess()
#18 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(169): CRM_Core_Form->mainProcess()
#19 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(136): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Member_Form_Membership), "upload")
#20 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Member_Form_Membership), "upload")
#21 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Member_Form_Membership), "upload")
#22 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("upload")
#23 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Member/Page/Tab.php(301): CRM_Core_Controller->run()
#24 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Member/Page/Tab.php(374): CRM_Member_Page_Tab->edit()
#25 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(290): CRM_Member_Page_Tab->run((Array:4), NULL)
#26 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#27 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#28 /var/www/mysite.org/wp-content/plugins/civicrm/civicrm.php(1436): CRM_Core_Invoke::invoke((Array:4))
#29 /var/www/mysite.org/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress->invoke("")
#30 /var/www/mysite.org/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#31 /var/www/mysite.org/wp-includes/plugin.php(465): WP_Hook->do_action((Array:1))
#32 /var/www/mysite.org/wp-admin/admin.php(253): do_action("toplevel_page_CiviCRM")
#33 {main}
```https://lab.civicrm.org/dev/membership/-/issues/10"Start date must be the same or later than Member since" triggered when dates...2022-04-22T16:17:29Zcalbasi"Start date must be the same or later than Member since" triggered when dates are the sameI get this issue on my drupal/civicrm 5.10.3 instance. And I test it, and I've found it there too: https://civicrm.demo.civihosting.com
Using the same date for "start date" and "member since" fields should NOT trigger this error.
My w...I get this issue on my drupal/civicrm 5.10.3 instance. And I test it, and I've found it there too: https://civicrm.demo.civihosting.com
Using the same date for "start date" and "member since" fields should NOT trigger this error.
My workaround was change one of 2 dates, but this issue is a bug and an usability issue.5.11