I came across the problem raised in this issue Resource Conflict to prevent conflicting event times some kind of hook in fullcalendar_update to validate and abort the node/entity_save would have been perfect.whilst working on a project recently. I solved it in my own plugin with a custom dropEvent callback as I had other advanced functionality I needed to implement. However had my requirement just been to use
Fullcalendar is a calendar and as such deals with events, it also allows for the editing of event via the drag/drop interface. I imagine a desire to prevent time/date conflicts of events is not uncommon and can easily be done using Resource Conflict via the standard add/edit form, this should also be possible when updating via fullcalendar.
The patch below provides a hook_fullcalendar_event_update_validate() that allows modules to modify the entity that is being updated and/or provide a veto response that would abort the entity/node_save.
Following on the ajax reponse includes 'success' or 'error' status that is used to apply a corresponding class to the fullcalendar-status div and also a corresponding message to be used.
Another approach was to check for Resource Conflict and run the entity through the two functions provided by this module to get this information. I did not feel this was a very flexible solution.
This patch does not allow for custom or multiple 'error' or 'success' messages to be returned by modules. Ideally all messages from all modules should be returned and displayed for user information.
The API documentation will likely need work.
This is a proof of concept to find out what everyone thinks of this approach.
User interface changes
A new message for 'error' status displayed to calendar user.
New hook addded hook_fullcalendar_event_update_validate(). This does not affect any current installations.
Original report by [username]