+ /**
+ * This wrangling of the financialType ID was happening in a shared function rather than in the form it relates to & hence has been moved to that form
+ * Pledges are not relevant to the membership code so that portion will not go onto the membership form.
+ *
+ * Comments from previous refactor indicate doubt as to what was going on
+ * @param $contributionTypeId
+ *
+ * @return null|string
+ */
+ function wrangleFinancialTypeID($contributionTypeId) {
+ if (isset($paymentParams['financial_type'])) {
+ $contributionTypeId = $paymentParams['financial_type'];
+ }
+ elseif (!empty($this->_values['pledge_id'])) {
+ $contributionTypeId = CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_Pledge',
+ $this->_values['pledge_id'],
+ 'financial_type_id'
+ );
+ }
+ return $contributionTypeId;
+ }
+