After debugging I've found the call Runner::run throws an exception:
Error calling PUT https://www.googleapis.com/calendar/v3/calendars/simon%40axcultures.com/events/c4gaod83c0r82efkbb7nuo48hg?sendNotifications=false: (404) Not Found
At the moment, changing the employee in back-end will not update the associated employee's Google Calendar, as you confirmed in your testing.
Our developers are aware of this, and they will work on the issue for one of our future updates. I can't say when it will be resolved, but it is on our "to-do" list.
Updated the code myself in Google CalendarService.php and it seems to be working pretty well:
public function handleEvent($appointment, $commandSlug, $originalEmployeeId = null) { /** @var ProviderRepository $providerRepository */ $providerRepository = $this->container->get('domain.users.providers.repository');
$appointmentStatus = $appointment->getStatus()->getValue();
$provider = $providerRepository->getById($appointment->getProviderId()->getValue());
if ($provider->getGoogleCalendar() && $provider->getGoogleCalendar()->getCalendarId()->getValue()) { $this->authorizeProvider($provider);
switch ($commandSlug) { case AppointmentAddedEventHandler::APPOINTMENT_ADDED: case BookingAddedEventHandler::BOOKING_ADDED: // Add new appointment or update existing one if (!$appointment->getGoogleCalendarEventId()) { $this->insertEvent($appointment, $provider); } else { $this->updateEvent($appointment, $provider); }
// When status is pending we must first insert the event to get event ID // because if we update the status later to 'Approved' we must have ID of the event if ($appointmentStatus === 'pending' && $this->settings['insertPendingAppointments'] === false) { $this->deleteEvent($appointment, $provider); } break; case AppointmentEditedEventHandler::APPOINTMENT_EDITED: case AppointmentTimeUpdatedEventHandler::TIME_UPDATED: case AppointmentStatusUpdatedEventHandler::APPOINTMENT_STATUS_UPDATED: case BookingCanceledEventHandler::BOOKING_CANCELED: if ($appointmentStatus === 'canceled' || $appointmentStatus === 'rejected' || ($appointmentStatus === 'pending' && $this->settings['insertPendingAppointments'] === false) ) { $this->deleteEvent($appointment, $provider); break; }
if (($commandSlug == AppointmentEditedEventHandler::APPOINTMENT_EDITED) && ($originalEmployeeId !== null) && ($originalEmployeeId != $provider->getId()->getValue())) { $appointment->setProviderId(new \AmeliaBooking\Domain\ValueObjects\Number\Integer\Id($originalEmployeeId));
$this->deleteEvent($appointment, $providerRepository->getById($originalEmployeeId));
$appointment->setProviderId($provider->getId());
$this->insertEvent($appointment, $provider); } else { $this->updateEvent($appointment, $provider); } break; case AppointmentDeletedEventHandler::APPOINTMENT_DELETED: $this->deleteEvent($appointment, $provider); break; } } }
I just tested changing the time of the appointment too, and this is not reflected in the Google Calendar either...
After debugging I've found the call Runner::run throws an exception:
Error calling PUT https://www.googleapis.com/calendar/v3/calendars/simon%40axcultures.com/events/c4gaod83c0r82efkbb7nuo48hg?sendNotifications=false: (404) Not Found
Call stack:
Furthermore, I was successful in changing the time if I kept the original employee - but once I changed the employee no other changes were synced...
Hello Simon
Thank you for your purchase.
At the moment, changing the employee in back-end will not update the associated employee's Google Calendar, as you confirmed in your testing.
Our developers are aware of this, and they will work on the issue for one of our future updates. I can't say when it will be resolved, but it is on our "to-do" list.
Sorry for the inconvenience.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Updated the code myself in Google CalendarService.php and it seems to be working pretty well:
Awesome, Simon, thank you very much for this!
I forwarded the code to our developers, so they will implement the change in our next update.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
You'll need to make sure everyone has edit permissions on eachother's calendars also:
https://stackoverflow.com/questions/14003203/403-forbidden-message-when-calling-the-v3-google-calendar-api-using-a-service-ac
https://stackoverflow.com/questions/11863022/edit-google-calendar-events-from-google-service-account-403/11897793#11897793
Thank you once again, Simon!
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables