Skip to content

A platform for community discussion. Free, open, simple.

FIX: Avoid reloading post in post events so that the revisor doesn't reset (#39284)

Natalie Tay97f0ddf757ab
diff --git a/plugins/discourse-calendar/plugin.rb b/plugins/discourse-calendar/plugin.rb
index 17ce6c6aab1..5278cd3526d 100644
--- a/plugins/discourse-calendar/plugin.rb
+++ b/plugins/discourse-calendar/plugin.rb
@@ -243,7 +243,7 @@ after_initialize do
on(:post_created) do |post|
DiscoursePostEvent::Event.update_from_raw(post)
- post.reload
+ post.association(:event).reload
if SiteSetting.discourse_post_event_enabled && post.event
WebHook.enqueue_calendar_event_hooks(:calendar_event_created, post.event)
end
@@ -253,7 +253,7 @@ after_initialize do
event_before = post.event
had_image_before = event_before&.image_upload_id.present?
DiscoursePostEvent::Event.update_from_raw(post)
- post.reload
+ post.association(:event).reload
if SiteSetting.discourse_post_event_enabled
if post.event&.image_upload_id