Skip to content

Commit

Permalink
Editing list items in a list propagate disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
freimutt committed Feb 3, 2020
1 parent f6f526c commit 25bb280
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.2.3 - 2020-02-03
### Fixed
- Fixed a bug when editing list items in a list with propagate disabled

## 1.2.2.1 - 2020-01-29
### Fixed
- Fixed a bug when selecting entries in multisite environment
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dutchheight/craft-navie",
"description": "Navigation plugin for Craft CMS 3",
"type": "craft-plugin",
"version": "1.2.2.1",
"version": "1.2.3",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 2 additions & 0 deletions src/controllers/ListsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ public function actionEditListItem(string $listHandle = null, string $siteHandle
'listItem' => $listItem
];

$siteHandle = $siteHandle ?? Craft::$app->getRequest()->getQueryParam('site', null);

if ($siteHandle !== null) {
$variables['site'] = Craft::$app->getSites()->getSiteByHandle($siteHandle);

Expand Down
24 changes: 12 additions & 12 deletions src/elements/ListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@

namespace dutchheight\navie\elements;

use dutchheight\navie\Navie;
use dutchheight\navie\elements\db\ListItemQuery;
use dutchheight\navie\models\ListModel;
use dutchheight\navie\records\ListItemRecord;

use Craft;
use craft\base\Element;
use craft\controllers\ElementIndexesController;
use craft\db\Query;
use craft\elements\db\ElementQuery;
use craft\elements\db\ElementQueryInterface;
use craft\elements\actions\Edit;
use craft\elements\actions\SetStatus;

use craft\elements\actions\DeepDuplicate;
use craft\elements\actions\Delete;
use craft\elements\actions\NewChild;
use craft\elements\actions\Duplicate;
use craft\elements\actions\DeepDuplicate;
use craft\elements\actions\Edit;
use craft\elements\actions\NewChild;
use craft\elements\actions\SetStatus;
use craft\elements\Asset;
use craft\elements\Category;
use craft\elements\db\ElementQuery;
use craft\elements\db\ElementQueryInterface;
use craft\elements\Entry;
use craft\helpers\ArrayHelper;
use craft\helpers\UrlHelper;
use craft\services\Elements;
use dutchheight\navie\elements\db\ListItemQuery;
use dutchheight\navie\models\ListModel;
use dutchheight\navie\Navie;
use dutchheight\navie\records\ListItemRecord;
use yii\base\InvalidConfigException;

class ListItem extends Element
Expand Down Expand Up @@ -443,7 +443,7 @@ public function getElement()
}

if ($this->elementId !== null) {
return $this->_element = Craft::$app->elements->getElementById($this->elementId);
return $this->_element = Craft::$app->elements->getElementById($this->elementId, null, $this->siteId);
}

return null;
Expand Down

0 comments on commit 25bb280

Please sign in to comment.