Skip to content

Commit 3824371

Browse files
committed
Fixed #15082
1 parent 6354e92 commit 3824371

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Fixed a bug where field layout designers weren’t displaying native fields in the library pane when a tab was removed that contained them. ([#15064](https://github.com/craftcms/cms/issues/15064))
1313
- Fixed a bug where recent textual changes could be lost when creating a new inline-editable Matrix block, if the block was created before the autosave had a chance to initiate. ([#15069](https://github.com/craftcms/cms/issues/15069))
1414
- Fixed a bug where the `users/create` command would fail without explaining why, when the maximum number of users had already been reached.
15+
- Fixed a validation error that could occur when saving an entry on Craft Solo. ([#15082](https://github.com/craftcms/cms/issues/15082))
1516

1617
## 5.1.7 - 2024-05-25
1718

src/elements/Entry.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,8 +2201,15 @@ private function _userPostDate(): ?DateTime
22012201
*/
22022202
public function beforeValidate(): bool
22032203
{
2204-
if (!isset($this->_authorIds) && !isset($this->fieldId) && $this->getSection()->type !== Section::TYPE_SINGLE) {
2205-
$this->setAuthor(Craft::$app->getUser()->getIdentity());
2204+
if (
2205+
(!isset($this->_authorIds) || empty($this->_authorIds)) &&
2206+
!isset($this->fieldId) &&
2207+
$this->getSection()->type !== Section::TYPE_SINGLE
2208+
) {
2209+
$user = Craft::$app->getUser()->getIdentity();
2210+
if ($user) {
2211+
$this->setAuthor($user);
2212+
}
22062213
}
22072214

22082215
if (

0 commit comments

Comments
 (0)