Skip to content
Snippets Groups Projects
Commit 3cbcc701 authored by Monish Deb's avatar Monish Deb
Browse files

issue-2 fix

parent b765afef
No related branches found
No related tags found
No related merge requests found
<?php
class CRM_Contributionpagecustomfield_APIWrapper implements API_Wrapper {
/**
* the wrapper contains a method that allows you to alter the parameters of the api request (including the action and the entity)
*/
public function fromApiInput($apiRequest) {
return $apiRequest;
}
/**
* Alter the result before returning it to the caller.
*/
public function toApiOutput($apiRequest, $result) {
if (!empty($apiRequest['params'])) {
$id = $result['id'];
contributionpagecustomfield_storeCustomField($apiRequest['params'], $id);
}
return $result;
}
}
...@@ -150,12 +150,6 @@ function contributionpagecustomfield_civicrm_preProcess($formName, &$form) { ...@@ -150,12 +150,6 @@ function contributionpagecustomfield_civicrm_preProcess($formName, &$form) {
if ($id) { if ($id) {
$form->assign('entityID', $id); $form->assign('entityID', $id);
} }
if (!empty($_POST['hidden_custom'])) {
$form->set('type', 'ContributionPage');
CRM_Custom_Form_CustomData::preProcess($form, NULL, NULL, 1, 'ContributionPage', $id);
CRM_Custom_Form_CustomData::buildQuickForm($form);
CRM_Custom_Form_CustomData::setDefaultValues($form);
}
} }
} }
...@@ -173,18 +167,6 @@ function contributionpagecustomfield_civicrm_postProcess($formName, &$form) { ...@@ -173,18 +167,6 @@ function contributionpagecustomfield_civicrm_postProcess($formName, &$form) {
} }
} }
/**
* Implements hook_civicrm_apiWrappers().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_apiWrappers
*
*/
function contributionpagecustomfield_civicrm_apiWrappers(&$wrappers, $apiRequest) {
if ($apiRequest['entity'] == 'ContributionPage' && $apiRequest['action'] == 'create') {
$wrappers[] = new CRM_Contributionpagecustomfield_APIWrapper();
}
}
/** /**
* Function to process custom fields for contribution page. * Function to process custom fields for contribution page.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment