A platform for community discussion. Free, open, simple.
Always link post to uploads in post process.
Guo Xiang Tand4b05d7bc5ec
diff --git a/app/models/post.rb b/app/models/post.rbindex 293bed1a29a..92ed3773125 100644--- a/app/models/post.rb+++ b/app/models/post.rb@@ -650,11 +650,10 @@ class Post < ActiveRecord::Baseend# Enqueue post processing for this post- def trigger_post_process(bypass_bump: false, skip_link_post_uploads: false)+ def trigger_post_process(bypass_bump: false)args = {post_id: id,bypass_bump: bypass_bump,- skip_link_post_uploads: skip_link_post_uploads}args[:image_sizes] = image_sizes if image_sizes.present?args[:invalidate_oneboxes] = true if invalidate_oneboxes.present?diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rbindex 467a7fbc563..c64edce2854 100644--- a/lib/cooked_post_processor.rb+++ b/lib/cooked_post_processor.rb@@ -35,16 +35,12 @@ class CookedPostProcessorpost_process_oneboxespost_process_imagespost_process_quotes-- unless @opts[:skip_link_post_uploads]- @post.link_post_uploads(fragments: @doc)- end-optimize_urlsupdate_post_imageenforce_nofollowpull_hotlinked_images(bypass_bump)grant_badges+ @post.link_post_uploads(fragments: @doc)DiscourseEvent.trigger(:post_process_cooked, @doc, @post)nilenddiff --git a/lib/post_creator.rb b/lib/post_creator.rbindex 9cfe9c2fcc8..aa6c75c72bb 100644--- a/lib/post_creator.rb+++ b/lib/post_creator.rb@@ -189,7 +189,7 @@ class PostCreatorpublishtrack_latest_on_category- enqueue_jobs(skip_link_post_uploads: true) unless @opts[:skip_jobs]+ enqueue_jobs unless @opts[:skip_jobs]BadgeGranter.queue_badge_grant(Badge::Trigger::PostRevision, post: @post)trigger_after_events unless opts[:skip_events]@@ -214,13 +214,12 @@ class PostCreator@postend- def enqueue_jobs(skip_link_post_uploads: false)+ def enqueue_jobsreturn unless @post && [email protected]?PostJobsEnqueuer.new(@post, @topic, new_topic?,import_mode: @opts[:import_mode],- post_alert_options: @opts[:post_alert_options],- skip_link_post_uploads: skip_link_post_uploads+ post_alert_options: @opts[:post_alert_options]).enqueue_jobsenddiff --git a/lib/post_jobs_enqueuer.rb b/lib/post_jobs_enqueuer.rbindex a0abef96c0d..4dde3b73afa 100644--- a/lib/post_jobs_enqueuer.rb+++ b/lib/post_jobs_enqueuer.rb@@ -38,9 +38,7 @@ class PostJobsEnqueuerenddef trigger_post_post_process- @post.trigger_post_process(- skip_link_post_uploads: @opts[:skip_link_post_uploads]- )+ @post.trigger_post_processenddef after_post_creatediff --git a/spec/components/post_creator_spec.rb b/spec/components/post_creator_spec.rbindex ecb30681dfc..2ad2736ab28 100644--- a/spec/components/post_creator_spec.rb+++ b/spec/components/post_creator_spec.rb@@ -193,7 +193,6 @@ describe PostCreator dotopic_id = post.topic_idprocess_post_args = Jobs::ProcessPost.jobs.first["args"].first- expect(process_post_args["skip_link_post_uploads"]).to eq(true)expect(process_post_args["post_id"]).to eq(post_id)feature_topic_users_args = Jobs::FeatureTopicUsers.jobs.first["args"].first