mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
FIX: Various fixes to support posts with no user (#8877)
* Do not grant badges for posts with no user * Ensure instructions are correct in Change Owner modal * Hide user-dependent actions from posts with no user * Make PostRevisor work with posts with no user * Ensure posts with no user can be deleted * discourse-narrative-bot should ignore posts with no user * Skip TopicLink creation for posts with no user
This commit is contained in:
parent
6fdb4c33a6
commit
0754c7c404
9 changed files with 19 additions and 12 deletions
|
@ -1,6 +1,8 @@
|
|||
{{#d-modal-body class='change-ownership'}}
|
||||
<span>
|
||||
{{i18n 'topic.change_owner.instructions' count=selectedPostsCount old_user=selectedPostsUsername}}
|
||||
{{i18n (if selectedPostsUsername 'topic.change_owner.instructions' 'topic.change_owner.instructions_without_old_user')
|
||||
count=selectedPostsCount
|
||||
old_user=selectedPostsUsername}}
|
||||
</span>
|
||||
|
||||
<form>
|
||||
|
|
|
@ -73,7 +73,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
|
|||
});
|
||||
}
|
||||
|
||||
if (currentUser.staff) {
|
||||
if (attrs.user_id && currentUser.staff) {
|
||||
if (siteSettings.enable_badges) {
|
||||
contents.push({
|
||||
icon: "certificate",
|
||||
|
|
|
@ -108,7 +108,7 @@ class TopicLink < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.extract_from(post)
|
||||
return if post.blank? || post.whisper?
|
||||
return if post.blank? || post.whisper? || post.user_id.blank?
|
||||
|
||||
current_urls = []
|
||||
reflected_ids = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue