diff --git a/CHANGELOG.md b/CHANGELOG.md index 88e4dfe..005f05f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Solspace Calendar Changelog +## 2.0.13 - 2019-01-22 +### Fixed +- Fixed a bug where Live Preview was not working correctly in Craft 3.0. +- Fixed a bug where Craft 2 to 3 migration was incorrectly migrating the Calendar Event Element type. + ## 2.0.12 - 2018-12-28 ### Changed - Updated Demo Templates installer to be compatible with Craft 3.1. diff --git a/LICENSE.md b/LICENSE.md index edeacca..0d643a9 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -33,7 +33,7 @@ corruption of data, and any necessary service, repair, or correction. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, INCLUDING SPECIAL, INCIDENTAL AND CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION diff --git a/README.md b/README.md index 885efb9..37a0b34 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,4 @@ Last but not least, included with Solspace Calendar is a set of Demo Templates t ## Using Calendar -Full documentation for Calendar can be found on the [Solspace website](https://solspace.com/craft/calendar/docs). +Full documentation for Calendar can be found on the [Solspace documentation website](http://docs.solspace.com/craft/calendar/v2/). diff --git a/composer.json b/composer.json index ad9bfaf..e6ca566 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "solspace/craft3-calendar", "description": "The most powerful event management plugin for Craft.", - "version": "2.0.12", + "version": "2.0.13", "type": "craft-plugin", "authors": [ { @@ -31,7 +31,7 @@ "name": "Calendar", "developer": "Solspace", "developerUrl": "https://solspace.com/craft/calendar", - "documentationUrl": "https://solspace.com/craft/calendar/docs", + "documentationUrl": "http://docs.solspace.com/craft/calendar/v2/", "changelogUrl": "https://raw.githubusercontent.com/solspace/craft3-calendar/master/CHANGELOG.md", "hasSettings": true, "hasCpSection": true diff --git a/src/Controllers/EventsController.php b/src/Controllers/EventsController.php index 65194d0..7d1611d 100644 --- a/src/Controllers/EventsController.php +++ b/src/Controllers/EventsController.php @@ -387,6 +387,11 @@ private function renderEditForm(Event $event, string $title): Response $siteIds = [\Craft::$app->getSites()->getPrimarySite()->id]; } + $previewActionUrl = 'calendar/events/preview'; + if (version_compare(\Craft::$app->getVersion(), '3.1', '>=')) { + $previewActionUrl = \Craft::$app->getSecurity()->hashData($previewActionUrl); + } + // Enable Live Preview? $showPreviewButton = false; if (!\Craft::$app->getRequest()->isMobileBrowser(true) && $this->getCalendarService()->isEventTemplateValid($calendar, $event->siteId)) { @@ -394,7 +399,7 @@ private function renderEditForm(Event $event, string $title): Response 'fields' => '#title-field, #fields .calendar-event-wrapper > .field, #fields > .field > .field', 'extraFields' => '#settings', 'previewUrl' => $event->getUrl(), - 'previewAction' => \Craft::$app->getSecurity()->hashData('calendar/events/preview'), + 'previewAction' => $previewActionUrl, 'previewParams' => [ 'eventId' => $event->id, 'siteId' => $event->siteId, diff --git a/src/migrations/m180619_120655_MigrateCalendarElementsAndLayouts.php b/src/migrations/m180619_120655_MigrateCalendarElementsAndLayouts.php index 4f2505b..c69b3e9 100644 --- a/src/migrations/m180619_120655_MigrateCalendarElementsAndLayouts.php +++ b/src/migrations/m180619_120655_MigrateCalendarElementsAndLayouts.php @@ -4,6 +4,7 @@ use craft\db\Migration; use craft\db\Query; +use Solspace\Calendar\Elements\Event; use Solspace\Calendar\FieldTypes\EventFieldType; /** @@ -18,7 +19,7 @@ public function safeUp() { $this->update( '{{%elements}}', - ['type' => EventFieldType::class], + ['type' => Event::class], ['type' => 'Calendar_Event'], [], false @@ -26,7 +27,7 @@ public function safeUp() $this->update( '{{%fieldlayouts}}', - ['type' => EventFieldType::class], + ['type' => Event::class], ['type' => 'Calendar_Event'], [], false