CRM-5039 Test Build Fixes Continued
authoratif-shaikh <shaikh388@gmail.com>
Thu, 12 Feb 2015 09:46:20 +0000 (15:16 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Thu, 12 Feb 2015 09:46:20 +0000 (15:16 +0530)
----------------------------------------
* CRM-5039: Events don't always limit registrations to "max participants" setting
  https://issues.civicrm.org/jira/browse/CRM-5039

CRM/Event/Form/Registration.php
CRM/Event/Form/Registration/Register.php

index b3712698d47ab4fc8a8366cfb09ed012c7458899..407b1a632c70ba45156a93c20587f6979bf699cf 100644 (file)
@@ -1245,7 +1245,7 @@ WHERE  v.option_group_id = g.id
           $value = $element->getValue();
           if (in_array($value[0], $optIds)) {
             foreach ($element->_options as $option) {
-              if ($option['attr']['value'] === "crm_disabled_opt-{$element->getValue()[0]}") {
+              if ($option['attr']['value'] === "crm_disabled_opt-{$value[0]}") {
                 $placeholder = html_entity_decode($option['text']);
                 $element->updateAttributes(array('placeholder' => $placeholder));
                 break;
index d356cfebbbc5f258f21926f52e2d540d03012a40..3e5dc64e7af4e7bf22635f20db36b7f5376ba9c6 100644 (file)
@@ -1136,9 +1136,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
         $params['payment_action'] = 'Sale';
         $params['invoiceID'] = $invoiceID;
       }
-
-      if (!empty($this->get('params')) && is_array($this->get('params'))) {
-        $this->_params = $this->get('params');
+      $this->_params = $this->get('params');
+      if (!empty($this->_params) && is_array($this->_params)) {
         $this->_params[0] = $params;
       }
       else {