Skip to content

Commit

Permalink
Fixed #2687
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Apr 7, 2018
1 parent a32a896 commit 19107f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG-v2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes for Craft CMS 2.x

## Unreleased

### Fixed
- Fixed an error that occurred when saving a Single entry over Ajax. ([#2687](https://github.com/craftcms/cms/issues/2687))

## 2.6.3015 - 2018-04-06

### Changed
Expand Down
6 changes: 5 additions & 1 deletion src/controllers/EntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,11 @@ public function actionSaveEntry()
$return['cpEditUrl'] = $entry->getCpEditUrl();
}

$return['authorUsername'] = $entry->getAuthor()->username;
if (($author = $entry->getAuthor()) !== null)
{
$return['authorUsername'] = $author->username;
}

$return['dateCreated'] = DateTimeHelper::toIso8601($entry->dateCreated);
$return['dateUpdated'] = DateTimeHelper::toIso8601($entry->dateUpdated);
$return['postDate'] = ($entry->postDate ? DateTimeHelper::toIso8601($entry->postDate) : null);
Expand Down

0 comments on commit 19107f2

Please sign in to comment.