Skip to content

Commit

Permalink
Fixed #2940
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jun 2, 2018
1 parent 0d7b726 commit 4d6892b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- Fixed a bug where the “New entry” menu on the Entries index page was including sections that weren’t available in the selected site, and they weren’t linking to Edit Entry pages for the selected site. ([#2925](https://github.com/craftcms/cms/issues/2925))
- Fixed a bug where the `|date`, `|time`, and `|datetime` filters weren’t respecting their `$timezone` arguments. ([#2926](https://github.com/craftcms/cms/issues/2926))
- Fixed a SQL syntax error that could occur in the Control Panel in some edge-case environments.
- Fixed a bug where element queries weren’t respecting the `asArray` param when calling `one()`. ([#2940](https://github.com/craftcms/cms/issues/2940))

## 3.0.9 - 2018-05-22

Expand Down
8 changes: 6 additions & 2 deletions src/elements/db/ElementQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,12 @@ public function one($db = null)
return reset($cachedResult) ?: null;
}

$row = parent::one($db);
return $row ? $this->_createElement($row) : null;
if ($row = parent::one($db)) {
$elements = $this->populate([$row]);
return reset($elements) ?: null;
}

return null;
}

/**
Expand Down

0 comments on commit 4d6892b

Please sign in to comment.