Cal extension bugfix

The cal extension 1.1 has a bug where if you try to add a new event that is not all day, you get a 500 error on the ajax, because there’s no key allDay in the request.

This is a fix for that bug:




	Modified protected/modules/cal/controllers/MainController.php

diff --git a/protected/modules/cal/controllers/MainController.php b/protected/modules/cal/controllers/MainController.php

index bf4bf0e..2ebaa53 100644

--- a/protected/modules/cal/controllers/MainController.php

+++ b/protected/modules/cal/controllers/MainController.php

@@ -81,7 +81,7 @@ class MainController extends Controller

         $title = $_POST['title'];

         $start = $_POST['start'];

         $end = $_POST['end'];

-        $allDay = ($_POST['allDay'] == 'true') ? 1 : 0;

+        $allDay = (isset($_POST['allDay']) && $_POST['allDay'] == 'true') ? 1 : 0;

         $editable = ($_POST['editable'] == 'true') ? 1 : 0;

         $eventId = $_POST['eventId'];

         if (Yii::app()->request->isAjaxRequest)






Apply the above to http://www.yiiframework.com/extension/cal/files/cal_1.1_demo.zip and non-all-day events will work.