Skip to content

Commit

Permalink
v2.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
kjmartens committed Jan 22, 2019
1 parent cb4c34a commit e330487
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/Controllers/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,19 @@ 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)) {
$this->getView()->registerJs('Craft.LivePreview.init(' . Json::encode([
'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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use craft\db\Migration;
use craft\db\Query;
use Solspace\Calendar\Elements\Event;
use Solspace\Calendar\FieldTypes\EventFieldType;

/**
Expand All @@ -18,15 +19,15 @@ public function safeUp()
{
$this->update(
'{{%elements}}',
['type' => EventFieldType::class],
['type' => Event::class],
['type' => 'Calendar_Event'],
[],
false
);

$this->update(
'{{%fieldlayouts}}',
['type' => EventFieldType::class],
['type' => Event::class],
['type' => 'Calendar_Event'],
[],
false
Expand Down

0 comments on commit e330487

Please sign in to comment.