diff --git a/TODO b/TODO index 9c996a5f..d9fdc0a4 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ first major release. - autocomplete: don't show items that are already used in tag list (unsure) - posts/upload: ability to paste many urls (unsure) - posts/listing: add buttons for toggling safety -- posts: fix empty edit snapshots when changing only thumbnail content - users: add user-configurable "about me" (should support Markdown) - tags: refresh tags.json when editing post - tags: add tag merging diff --git a/src/Services/PostSnapshotProvider.php b/src/Services/PostSnapshotProvider.php index d850abd2..b791e844 100644 --- a/src/Services/PostSnapshotProvider.php +++ b/src/Services/PostSnapshotProvider.php @@ -34,24 +34,27 @@ class PostSnapshotProvider 'featured' => $isFeatured, 'tags' => - array_map( + array_values(array_map( function ($tag) { return $tag->getName(); }, - $post->getTags()), + $post->getTags())), 'relations' => - array_map( + array_values(array_map( function ($post) { return $post->getId(); }, - $post->getRelatedPosts()), + $post->getRelatedPosts())), 'flags' => $flags, ]; + sort($data['tags']); + sort($data['relations']); + $snapshot = $this->getPostSnapshot($post); $snapshot->setOperation(Snapshot::OPERATION_CHANGE); $snapshot->setData($data);