-
- self::createMembershipPriceField($params, $ids, $previousID, $membershipType->id);
+ if ($id) {
+ // on update we may need to retrieve some details for the price field function - otherwise we get e-notices on attempts to retrieve
+ // name etc - the presence of previous id tells us this is an update
+ $params = array_merge(civicrm_api3('membership_type', 'getsingle', array('id' => $membershipType->id)), $params);
+ }
+ self::createMembershipPriceField($params, $previousID, $membershipType->id);