#29759 edit, template becomes empty
authorJagadedes <jagadees.pillai@zyxware.com>
Tue, 21 Oct 2014 10:38:42 +0000 (16:08 +0530)
committerJagadedes <jagadees.pillai@zyxware.com>
Tue, 21 Oct 2014 10:38:42 +0000 (16:08 +0530)
CRM/Wci/Form/CreateWidget.php

index 4315bd5779893800e12d8d2748f7e8e5c0ea66ad..bbf4b931872707e6ad1cab87919c5d84d7ffda85 100644 (file)
@@ -211,6 +211,10 @@ where w.id=" . $this->_id;
           $cust_templ = base64_decode($wid_page[$dao->id]['custom_template']);
           $this->setDefaults(array(
               'custom_template' => $cust_templ));
+        } else {
+          $output = file_get_contents('templates/CRM/Wci/Page/wciwidget.tpl',FILE_USE_INCLUDE_PATH);
+          $elem = $this->getElement('custom_template');
+          $elem->setValue($output);
         }
       }
       // $widget_controller_path = getWciWidgetControllerPath();
@@ -230,7 +234,7 @@ where w.id=" . $this->_id;
       /** Keep template in civicrm-wci/templates folder*/
       $output = file_get_contents('templates/CRM/Wci/Page/wciwidget.tpl',FILE_USE_INCLUDE_PATH);
       $elem = $this->getElement('custom_template');
-      $elem->setValue($output); 
+      $elem->setValue($output);
     }
     parent::buildQuickForm();
   }