Skip to content

Commit

Permalink
fix(SFT-1158): Replaced custom UpdateEventsUriJob with Craft’s Update…
Browse files Browse the repository at this point in the history
…ElementSlugsAndUris job to correctly parse URI parameters (#295)
  • Loading branch information
seandelaney authored Jun 7, 2024
1 parent c7a183a commit 6b09067
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 52 deletions.
16 changes: 10 additions & 6 deletions packages/plugin/src/Controllers/CalendarsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
use craft\helpers\UrlHelper;
use craft\models\FieldLayout;
use craft\models\FieldLayoutTab;
use craft\queue\jobs\UpdateElementSlugsAndUris;
use craft\records\Field;
use Solspace\Calendar\Calendar;
use Solspace\Calendar\Elements\Event;
use Solspace\Calendar\Jobs\UpdateEventsUriJob;
use Solspace\Calendar\Library\Helpers\DateHelper;
use Solspace\Calendar\Library\Helpers\PermissionHelper;
use Solspace\Calendar\Library\Helpers\SitesHelper;
Expand Down Expand Up @@ -293,11 +293,15 @@ public function actionSaveCalendar(): Response
// Save it
if ($this->getCalendarService()->saveCalendar($calendar)) {
if ($hasUriFormatChanges) {
foreach ($calendar->siteSettings as $siteSetting) {
Queue::push(new UpdateEventsUriJob([
'calendarId' => $calendar->id,
'siteId' => $siteSetting->siteId,
'uriFormat' => $siteSetting->uriFormat,
$events = Calendar::getInstance()->events->getEventQuery([
'calendarId' => $calendar->id,
])->all();

foreach ($events as $event) {
Queue::push(new UpdateElementSlugsAndUris([
'elementId' => $event->id,
'elementType' => $event::class,
'updateDescendants' => false,
]));
}
}
Expand Down
46 changes: 0 additions & 46 deletions packages/plugin/src/Jobs/UpdateEventsUriJob.php

This file was deleted.

0 comments on commit 6b09067

Please sign in to comment.