From 1b746dbefa2a10aaf3d965421cdb5948376cac01 Mon Sep 17 00:00:00 2001 From: Rebeca Mora Anca Date: Sun, 23 Aug 2015 19:46:49 +0100 Subject: [PATCH] Fixing controller issues --- Controller/CalendarController.php | 2 +- Event/CalendarEvent.php | 2 +- README.md | 4 ++-- Resources/config/services.yml | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Controller/CalendarController.php b/Controller/CalendarController.php index 8849ab8..95c40d1 100644 --- a/Controller/CalendarController.php +++ b/Controller/CalendarController.php @@ -18,7 +18,6 @@ public function loadAction(Request $request) $startDate = new \DateTime($request->get('start')); $endDate = new \DateTime($request->get('end')); $filters = $request->get('filters', []); - $content = []; try { $content = $this @@ -26,6 +25,7 @@ public function loadAction(Request $request) ->getData($startDate, $endDate, $filters); $status = empty($content) ? Response::HTTP_NO_CONTENT : Response::HTTP_OK; } catch (\Exception $exception) { + $content = ''; $status = Response::HTTP_INTERNAL_SERVER_ERROR; } diff --git a/Event/CalendarEvent.php b/Event/CalendarEvent.php index 47bb4e5..fda86b6 100644 --- a/Event/CalendarEvent.php +++ b/Event/CalendarEvent.php @@ -27,7 +27,7 @@ class CalendarEvent extends Event /** * @var EventInterface[] */ - protected $events; + protected $events = []; /** * @param \Datetime $star diff --git a/README.md b/README.md index 121a4e2..112f347 100644 --- a/README.md +++ b/README.md @@ -183,10 +183,10 @@ $(function () { eventDurationEditable: true, eventSources: [ { - url: /your/custom/route, + url: /full-calendar/load, type: 'POST', data: { - + filters: { param: foo } } error: function() { //alert() diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 25f3908..21c52b0 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -5,7 +5,6 @@ services: anca_rebeca_full_calendar.service.calendar: class: AncaRebeca\FullCalendarBundle\Service\Calendar - public: false arguments: - - @event_dispatcher - @anca_rebeca_full_calendar.service.serializer + - @event_dispatcher