Merge pull request #4726 from atif-shaikh/CRM-5039
[civicrm-core.git] / CRM / Event / Form / Registration / Register.php
index 0238d32753077715455acdd037ee6b119acb15ce..7a921d8509f7bb2ee91590626f9ff90fab1c84af 100644 (file)
@@ -745,18 +745,11 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
         $dbTotalCount      = CRM_Utils_Array::value($optId, $recordedOptionsCount, 0);
         $currentTotalCount = CRM_Utils_Array::value($optId, $currentOptionsCount, 0);
 
-        // Do not consider current count for select field,
-        // since we are not going to freeze the options.
-        if ($field['html_type'] == 'Select') {
-          $totalCount = $dbTotalCount;
-        }
-        else {
-          $totalCount = $currentTotalCount + $dbTotalCount;
-        }
 
+        $totalCount = $currentTotalCount + $dbTotalCount;
         $isFull = FALSE;
         if ($maxValue &&
-          (($totalCount >= $maxValue) || ($totalCount + $count > $maxValue))
+          (($totalCount > $maxValue) || ($totalCount + $count > $maxValue))
         ) {
           $isFull = TRUE;
           $optionFullIds[$optId] = $optId;