Missing start and end dates in fullcalender

Status
Not open for further replies.

achartier

Super Moderator
Staff member
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:
if (array_key_exists($listId, $model->events))
{
        $events = array_shift($model->events[$listId]);
        $startDateField = $events['startdate'];
        $endDateField   = $events['enddate'];
}
This solves the problem.
 
If you want to submit a PR, I'll merge it. I'm kind of swamped with site migration and catchup work atm.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top