Skip to content

Commit 13cc01f

Browse files
committed
Fixed #11973
1 parent 4f16229 commit 13cc01f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Fixed a bug where invalid entries could be duplicated via the “Save as a new entry” action, despite the duplication appearing to have failed with validation errors. ([#11959](https://github.com/craftcms/cms/issues/11959))
2020
- Fixed a PHP error that could occur in a potential race condition when calling `craft\helpers\FileHelper::clearDirectory()`.
2121
- Fixed a bug where Structure section entries that were duplicated via the “Save as a new entry” action on a provisional draft weren’t being placed within the structure properly.
22+
- Fixed a bug where element’s `searchScore` properties would be set to `null` when their original score was below 1, rather than rounding to 0 or 1. ([#11973](https://github.com/craftcms/cms/issues/11973))
2223

2324
## 3.7.54 - 2022-09-13
2425

src/base/Element.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ public function init()
18341834
$this->lft = (int)$this->lft ?: null;
18351835
$this->rgt = (int)$this->rgt ?: null;
18361836
$this->level = (int)$this->level ?: null;
1837-
$this->searchScore = (int)$this->searchScore ?: null;
1837+
$this->searchScore = $this->searchScore ? ((int)round($this->searchScore)) : null;
18381838
$this->trashed = (bool)$this->trashed;
18391839

18401840
parent::init();

0 commit comments

Comments
 (0)