Membership - archive issueshttps://lab.civicrm.org/dev/membership/-/issues2022-04-22T16:16:31Zhttps://lab.civicrm.org/dev/membership/-/issues/22Membership by Relationship not created when Current Employer field is updated2022-04-22T16:16:31ZalanpuccinelliMembership by Relationship not created when Current Employer field is updatedIt used to be that when a Current Employer was added to a profile it would automatically build the Relationship AND any Related membership. It now only seems to do the Relationship and you have to edit and re-save the profile and then th...It used to be that when a Current Employer was added to a profile it would automatically build the Relationship AND any Related membership. It now only seems to do the Relationship and you have to edit and re-save the profile and then the Membership will add.https://lab.civicrm.org/dev/membership/-/issues/26Membership end date is miscalculated on recurring payments that fail temporarily2022-04-22T16:16:32ZJonGoldMembership end date is miscalculated on recurring payments that fail temporarilyMembership organizations hate this one weird trick to get 17% off any membership!
To replicate:
* Create a monthly recurring membership using, say, Paypal. E.g. starting 2020-03-01, ending 2020-03-31.
* If the second recurring payment ...Membership organizations hate this one weird trick to get 17% off any membership!
To replicate:
* Create a monthly recurring membership using, say, Paypal. E.g. starting 2020-03-01, ending 2020-03-31.
* If the second recurring payment goes through on time, the membership end date is extended properly to 2020-04-30. However, if the payment fails, Paypal will retry 5 days later. If it goes through at that time, the membership end date will also be extended for 5 days.https://lab.civicrm.org/dev/membership/-/issues/31Unable to save a membership with a text price field2022-04-22T16:16:47ZDaveDUnable to save a membership with a text price fieldSame problem in 5.28 and master and can reproduce on dmaster.demo.civicrm.org. Or maybe I'm missing something.
1. Create a price set used for memberships.
1. Set financial type to member dues.
1. Add one text field (the default input fi...Same problem in 5.28 and master and can reproduce on dmaster.demo.civicrm.org. Or maybe I'm missing something.
1. Create a price set used for memberships.
1. Set financial type to member dues.
1. Add one text field (the default input field type).
1. Amount doesn't matter - put in some number.
1. Leave other fields at defaults.
1. Create a new membership.
1. Choose the price set.
1. Put in quantity 1.
1. Can leave the rest at defaults.
1. Click Save.
1. ERROR: Select at least one membership option.
It works with a radio field.https://lab.civicrm.org/dev/membership/-/issues/33Wrong frequency when purchasing a membership2022-04-22T16:17:46ZsudomanWrong frequency when purchasing a membershipWe patched a bug in CiviCRM core that has been around for a while now. When buying an annual membership, sometimes donors are charged the annual price, but on a monthly basis. (We offer both annual and monthly memberships on the same mem...We patched a bug in CiviCRM core that has been around for a while now. When buying an annual membership, sometimes donors are charged the annual price, but on a monthly basis. (We offer both annual and monthly memberships on the same membership page). This patch is a hack that works for us, but may have some hard coded values for our instance.
One way to check if your server has this problem is to use a payment processor like PayPal, which lets you see the recurring contrib details before you actually pay. This issue comes up somewhat randomly, so you might have to try a few times.
Thanks! : )
```
diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php
index 41fcb7da3e..075d29ab20 100644
--- a/CRM/Contribute/Form/ContributionBase.php
+++ b/CRM/Contribute/Form/ContributionBase.php
@@ -1371,7 +1371,14 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
$this->_params['is_recur'] = $this->_values['is_recur'] = 1;
// check if price set is not quick config
if (!empty($this->_params['priceSetId']) && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_params['priceSetId'], 'is_quick_config')) {
- list($this->_params['frequency_interval'], $this->_params['frequency_unit']) = CRM_Price_BAO_PriceSet::getRecurDetails($this->_params['priceSetId']);
+
+ // Extract the ids for all of the line items that have been chosen.
+ $priceFieldValueIds = array_keys($this->_lineItem[$this->_params['priceSetId']])[0];
+ if (empty($priceFieldValueIds))
+ $priceFieldValueIds = array_keys($this->_params['price_126'])[0];
+ list($this->_params['frequency_interval'], $this->_params['frequency_unit']) = CRM_Price_BAO_PriceSet::getRecurDetails($this->_params['priceSetId'], $priceFieldValueIds);
}
else {
// FIXME: set interval and unit based on selected membership type
diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php
index 91118ecd97..0277bdbaed 100644
--- a/CRM/Price/BAO/PriceSet.php
+++ b/CRM/Price/BAO/PriceSet.php
@@ -1332,13 +1332,14 @@ GROUP BY mt.member_of_contact_id ";
* @return array
* associate array of frequency interval and unit
*/
- public static function getRecurDetails($priceSetId) {
+ public static function getRecurDetails($priceSetId, $priceFieldValueIds) {
$query = 'SELECT mt.duration_interval, mt.duration_unit
FROM civicrm_price_field_value pfv
INNER JOIN civicrm_membership_type mt ON pfv.membership_type_id = mt.id
INNER JOIN civicrm_price_field pf ON pfv.price_field_id = pf.id
- WHERE pf.price_set_id = %1 LIMIT 1';
+ WHERE pf.price_set_id = %1 AND pfv.id = '
+ . $priceFieldValueIds . ' LIMIT 1';
$params = [1 => [$priceSetId, 'Integer']];
$dao = CRM_Core_DAO::executeQuery($query, $params);
```https://lab.civicrm.org/dev/membership/-/issues/37Creating a relationship fails when a related membership has a contact referen...2022-04-22T16:17:02ZjaapjansmaCreating a relationship fails when a related membership has a contact reference custom field.**How to reproduce?**
1. Create a new membership type. Set **Relationship type** to Employer of
2. Create a custom field set for this membership type
3. Add a custom field of type Contact Reference
4. Create a new organization
5. Add th...**How to reproduce?**
1. Create a new membership type. Set **Relationship type** to Employer of
2. Create a custom field set for this membership type
3. Add a custom field of type Contact Reference
4. Create a new organization
5. Add the membership and fill in a value at the custom field
6. Now add a **Employer of** relationship between this organization and an Individual, press save
**Expected results**
Relationship gets saved and a related membership is created with the correct value for the custom field
**Actual results**
No relationship is created, no error is shown, the civicrm logo stays on the screen turning around.
Also when refreshing the page an error popups with something: **custom_xx is not a valid integer**
**Extra information**
When debuging this issue I disovered that a `Membership.get` api is used. And those values are passed to a `Membership.create` api call. The paramaters for the custom field have the format of `custom_xx = 'Joe'` and `custom_xx_id = 202`5.39.0jaapjansmajaapjansma