Skip to content

Commit

Permalink
Fixed #15656
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Sep 4, 2024
1 parent 5c92113 commit f3164c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fixed a bug where element chips within thumbnail views weren’t getting light gray backgrounds. ([#15649](https://github.com/craftcms/cms/issues/15649))
- Fixed a bug where Link fields didn’t fully support inline editing. ([#15653](https://github.com/craftcms/cms/issues/15653))
- Fixed the loading spinner styling on element indexes. ([#15634](https://github.com/craftcms/cms/issues/15634))
- Fixed an error that could occur when saving an element. ([#15656](https://github.com/craftcms/cms/issues/15656))

## 5.4.0.1 - 2024-09-03

Expand Down
7 changes: 6 additions & 1 deletion src/services/Elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
use craft\helpers\Db;
use craft\helpers\ElementHelper;
use craft\helpers\Html;
use craft\helpers\Json;
use craft\helpers\Queue;
use craft\helpers\StringHelper;
use craft\helpers\UrlHelper;
Expand Down Expand Up @@ -3739,7 +3740,11 @@ private function _saveElementInternal(

// if we're supposed to save all the content
if ($saveContent || !empty($dirtyFields)) {
$oldContent = $siteSettingsRecord->content; // we'll need that if we're not saving all the content
$oldContent = $siteSettingsRecord->content ?? []; // we'll need that if we're not saving all the content
if (is_string($oldContent)) {
$oldContent = $oldContent !== '' ? Json::decode($oldContent) : [];
}

$content = [];
if ($fieldLayout) {
foreach ($fieldLayout->getCustomFields() as $field) {
Expand Down

0 comments on commit f3164c5

Please sign in to comment.