1. Fabrik 3.8.1 has been released. It is mostly bug fixes and feature enhancements, but does include two new plugins (push notifications, and the sequence element). As usual we strongly recommend testing the new release on a sandbox if your application is mission critical, and always do an Akeeba backup before updating.
    Dismiss Notice

Missing start and end dates in fullcalender

Discussion in 'Community' started by achartier, Sep 16, 2018 at 4:06 PM.

  1. achartier

    achartier Active Member

    Level: Community
    When you have more than one table associated with a fullcalendar visualization, the start and end date elements for tables other than the first one are not found. The reason for this is that the addEvForm in plugins/fabrik_visualization/fullcalendar/controllers/fullcalendar.php assumes that the event data is the first element of the $model->events[$listId] array, but this is not true.

    The $model->setUpEvents function call sets the index of the array to an index for the data tables as defined in the visualization configuration, so only the events array index may be something other than zero.

    The $model->setUpEvents call always returns an array with a single element so it is easy enough to ignore the element index and simply shift the first element off of the array.

    In this controller at line 89 is an if statement to determine if the listId is in the $model->events. The true block should read:
    Code (Text):

    if (array_key_exists($listId, $model->events))
            $events = array_shift($model->events[$listId]);
            $startDateField = $events['startdate'];
            $endDateField   = $events['enddate'];
    This solves the problem.
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    If you want to submit a PR, I'll merge it. I'm kind of swamped with site migration and catchup work atm.

    -- hugh
  3. achartier

    achartier Active Member

    Level: Community

Share This Page