From d4acad97886e53349902d704a66f01c911f61eb8 Mon Sep 17 00:00:00 2001 From: Sudha Bisht Date: Thu, 14 May 2015 10:24:08 +0530 Subject: [PATCH] Fix for expire priceset field --- CRM/Event/Form/Registration.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 75783bbff1..8538460866 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -674,12 +674,20 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { if (property_exists($form, '_discountId') && $form->_discountId) { $discountId = $form->_discountId; } + + //CRM-16456 get all price field including expired one. + $getAllPriceField = TRUE; + $className = CRM_Utils_System::getClassName($form); + if ($className == 'CRM_Event_Form_ParticipantFeeSelection' && $form->_action == CRM_Core_Action::UPDATE) { + $getAllPriceField = FALSE; + } + if ($discountId) { $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_BAO_Discount', $discountId, 'price_set_id'); - $price = CRM_Price_BAO_PriceSet::initSet($form, $eventID, 'civicrm_event', TRUE, $priceSetId); + $price = CRM_Price_BAO_PriceSet::initSet($form, $eventID, 'civicrm_event', $getAllPriceField, $priceSetId); } else { - $price = CRM_Price_BAO_PriceSet::initSet($form, $eventID, 'civicrm_event', TRUE); + $price = CRM_Price_BAO_PriceSet::initSet($form, $eventID, 'civicrm_event', $getAllPriceField); } if (property_exists($form, '_context') && ($form->_context == 'standalone' -- 2.25.1