Skip to content

Commit

Permalink
Fixed #3019
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jun 22, 2018
1 parent cb90210 commit 1ce8d3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Fixed a bug where passing `timezone=false` to the `|date`, `|time`, and `|datetime` filters would not preserve the given date’s time zone.
- Fixed a bug where AM/PM strings in formatted dates weren’t respecting the casing specified by the `A`/`a` character in the date format. ([#3007](https://github.com/craftcms/cms/issues/3007))
- Fixed a bug you could get an invalid license warning in cases where web API calls returned a 500 response code.
- Fixed a bug where custom field params were getting forgotten when calling `getNext()` and `getPrev()`, if an element query object was passed in. ([#3019](https://github.com/craftcms/cms/issues/3019))

## 3.0.12 - 2018-06-18

Expand Down
6 changes: 6 additions & 0 deletions src/base/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -2155,7 +2155,13 @@ private function _getRelativeElement($criteria, int $dir)
}

if ($criteria instanceof ElementQueryInterface) {
/** @var ElementQuery $criteria */
$query = clone $criteria;

// clone its behaviors too (https://github.com/yiisoft/yii2/issues/16247)
foreach ($criteria->getBehaviors() as $name => $behavior) {
$query->attachBehavior($name, clone $behavior);
}
} else {
$query = static::find()
->siteId($this->siteId);
Expand Down

0 comments on commit 1ce8d3c

Please sign in to comment.