Skip to content

Commit

Permalink
Fixed #15513
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Aug 10, 2024
1 parent 8460b5f commit 8f108a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fixed an error that occurred when installing Craft in PostgreSQL. ([#15504](https://github.com/craftcms/cms/issues/15504))
- Fixed a bug where Matrix fields weren’t retaining the sort order for disabled nested entries. ([#15505](https://github.com/craftcms/cms/issues/15505))
- Fixed a bug where Link fields weren’t displaying their input if they only had one type selected, and it wasn’t URL. ([#15512](https://github.com/craftcms/cms/issues/15512))
- Fixed a bug where elements’ `searchScore` values were `null` when ordering an element query by `score`. ([#15513](https://github.com/craftcms/cms/issues/15513))

## 5.3.1 - 2024-08-07

Expand Down
7 changes: 5 additions & 2 deletions src/elements/db/ElementQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -1696,8 +1696,11 @@ public function populate($rows): array
// Should we set a search score on the elements?
if (isset($this->_searchResults)) {
foreach ($rows as &$row) {
if (isset($row['id'], $this->_searchResults[$row['id']])) {
$row['searchScore'] = (int)round($this->_searchResults[$row['id']]);
if (isset($row['id'], $row['siteId'])) {
$key = sprintf('%s-%s', $row['id'], $row['siteId']);
if (isset($this->_searchResults[$key])) {
$row['searchScore'] = (int)round($this->_searchResults[$key]);
}
}
}
}
Expand Down

0 comments on commit 8f108a8

Please sign in to comment.