PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.5.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.5.0
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
← All changes | app/Http/Controllers/CalendarIntegrationController.php +10 -2 2.4.0 → 2.5.0 View file →
@@ -91,15 +91,23 @@
91 91 $calendarEvent = CalendarSlot::where('calendar_id', $calendarId)->findOrFail($slotId);
92 92
93 93 $fromEventId = intval($this->request->get('from_event_id'));
94 94
95 - if (!$fromEventId || !PermissionManager::canUpdateCalendarEvent($fromEventId)) {
95 + $fromEvent = CalendarSlot::find($fromEventId);
96 +
97 + if (!$fromEvent) {
96 98 return $this->sendError([
99 + 'message' => __('Source event not found', 'fluent-booking')
100 + ], 422);
101 + }
102 +
103 + if (!PermissionManager::canUpdateCalendarEvent($fromEvent->id)) {
104 + return $this->sendError([
97 105 'message' => __('You do not have permission to clone from the selected event.', 'fluent-booking')
98 106 ], 403);
99 107 }
100 108
101 - $fromEventIntegrations = Meta::where('object_id', $fromEventId)
109 + $fromEventIntegrations = Meta::where('object_id', $fromEvent->id)
102 110 ->where('object_type', 'integration')
103 111 ->get();
104 112
105 113 if ($fromEventIntegrations->isEmpty()) {