← All changes
|
app/Services/Integrations/CalendarIntegrationService.php
+9
-1
2.2.5
→
2.5.0
View file →
| @@ -28,9 +28,17 @@ | ||
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | 30 | $mergeFields = false; |
| 31 | 31 | if ($integrationId) { |
| 32 | - $feed = Meta::where(['object_id' => $slotId, 'id' => $integrationId])->first(); | |
| 32 | + $feed = Meta::where('id', $integrationId) | |
| 33 | + ->where('object_id', $slotId) | |
| 34 | + ->where('object_type', 'integration') | |
| 35 | + ->where('key', $integrationName . '_feeds') | |
| 36 | + ->first(); | |
| 37 | + | |
| 38 | + if (!$feed) { | |
| 39 | + throw new ValidationException(__('Integration feed not found', 'fluent-booking'), 404); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped | |
| 40 | + } | |
| 33 | 41 | |
| 34 | 42 | if ($feed->value) { |
| 35 | 43 | $settings = $feed->value; |
| 36 | 44 | $settings = apply_filters('fluent_booking/get_integration_values_' . $integrationName, $settings, $feed, $slotId); |