CRM-5039-Testbuild Fixes
authoratif-shaikh <shaikh388@gmail.com>
Thu, 12 Feb 2015 08:00:34 +0000 (13:30 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Thu, 12 Feb 2015 08:00:34 +0000 (13:30 +0530)
CRM/Event/Form/Registration.php
CRM/Event/Form/Registration/Register.php

index f35474ef1b28942607846b940b425db188097587..b3712698d47ab4fc8a8366cfb09ed012c7458899 100644 (file)
@@ -1242,7 +1242,8 @@ WHERE  v.option_group_id = g.id
           break;
 
         case 'select':
-          if (in_array($element->getValue()[0], $optIds)) {
+          $value = $element->getValue();
+          if (in_array($value[0], $optIds)) {
             foreach ($element->_options as $option) {
               if ($option['attr']['value'] === "crm_disabled_opt-{$element->getValue()[0]}") {
                 $placeholder = html_entity_decode($option['text']);
index da41970f232744293e6dc666d4306f89d2f87f06..d356cfebbbc5f258f21926f52e2d540d03012a40 100644 (file)
@@ -1091,8 +1091,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
         if ($params['tax_amount']) {
           $this->set('tax_amount', $params['tax_amount']);
         }
-        if (!empty($this->get('lineItem')) && is_array($this->get('lineItem'))) {
-          $submittedLineItems = $this->get('lineItem');
+        $submittedLineItems = $this->get('lineItem');
+        if (!empty($submittedLineItems) && is_array($submittedLineItems)) {
           $submittedLineItems[0] = $lineItem;
         }
         else {