From 9bb909ef371562a45a503e43e53224eb6ad62b4a Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Thu, 2 Feb 2017 13:31:43 +0530 Subject: [PATCH] CRM-19918: Price field 'Active on' date ignored in Edit Event Registration > 'Change Selections' --- CRM/Price/BAO/PriceSet.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index be5c02d6bc..6e4b0ff85f 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -471,17 +471,18 @@ WHERE cpf.price_set_id = %1"; $select = 'SELECT ' . implode(',', $priceFields); $from = ' FROM civicrm_price_field'; - $params = array(); - $params[1] = array($setID, 'Integer'); - $where = ' + $params = array( + 1 => array($setID, 'Integer'), + ); + $currentTime = date('YmdHis'); + $where = " WHERE price_set_id = %1 AND is_active = 1 -'; +AND ( active_on IS NULL OR active_on <= {$currentTime} ) +"; $dateSelect = ''; if ($validOnly) { - $currentTime = date('YmdHis'); $dateSelect = " -AND ( active_on IS NULL OR active_on <= {$currentTime} ) AND ( expire_on IS NULL OR expire_on >= {$currentTime} ) "; } -- 2.25.1