mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 06:55:03 -05:00
FIX: Narrative bot not working for bookmarks with reminders (#9289)
Reported https://meta.discourse.org/t/improved-bookmarks-with-reminders/144542/42?u=mjrbrennan * There was no callback on the bookmark model to trigger the next step of the narrative bot on bookmark. * Also the translation URL path was hardcoded, needs to be conditional based on whether the site setting is enabled.
This commit is contained in:
@@ -233,8 +233,14 @@ module DiscourseNarrativeBot
|
||||
return unless valid_topic?(@post.topic_id)
|
||||
return unless @post.user_id == self.discobot_user.id
|
||||
|
||||
profile_page_url = url_helpers(:user_url, username: @user.username)
|
||||
bookmark_url = if SiteSetting.enable_bookmarks_with_reminders?
|
||||
"#{profile_page_url}/activity/bookmarks-with-reminders"
|
||||
else
|
||||
"#{profile_page_url}/activity/bookmarks"
|
||||
end
|
||||
raw = <<~RAW
|
||||
#{I18n.t("#{I18N_KEY}.bookmark.reply", i18n_post_args(profile_page_url: url_helpers(:user_url, username: @user.username)))}
|
||||
#{I18n.t("#{I18N_KEY}.bookmark.reply", i18n_post_args(bookmark_url: bookmark_url))}
|
||||
|
||||
#{instance_eval(&@next_instructions)}
|
||||
RAW
|
||||
|
||||
Reference in New Issue
Block a user