diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index be5c02d6bc41..6e4b0ff85f3f 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -471,17 +471,18 @@ public static function getSetDetail($setID, $required = TRUE, $validOnly = FALSE $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} ) "; }