Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1.2'
Browse files Browse the repository at this point in the history
* release/1.1.2:
  Changelog for 1.1.2
  Fixes an exception that occured when trying to add a new commerce product with Portal installed.
  • Loading branch information
joshangell committed Feb 21, 2019
2 parents 0209984 + 9eb89c3 commit 699c98a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## Unreleased

## 1.1.2 - 2019-02-21

### Fixed
- Fixed an exception that occured when trying to add a new commerce product with Portal installed ([#8](https://github.com/angell-co/Portal/issues/8))


## 1.1.1 - 2019-02-19

Expand Down
11 changes: 10 additions & 1 deletion src/Portal.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,19 @@ private function _loadLivePreviewCpResources()

// Work out the Site
$siteHandle = null;
if (count($segments) === 4) {
if (count($segments) === 4 && $segments[ 3 ] !== 'new') {
$siteHandle = $segments[ 3 ];
}

// Deal with commerce routes
if ($segments[ 0 ] === 'commerce'
&& $segments[ 1 ] === 'products'
&& $segments[ 3 ] === 'new'
&& isset($segments[ 4 ])
) {
$siteHandle = $segments[ 4 ];
}

if ($siteHandle) {
$site = Craft::$app->getSites()->getSiteByHandle($siteHandle);

Expand Down

0 comments on commit 699c98a

Please sign in to comment.