diff --git a/plugin.rb b/plugin.rb index 7fedf57..b141052 100644 --- a/plugin.rb +++ b/plugin.rb @@ -4,7 +4,7 @@ # name: discourse-legacy_links # about: A plugin to handle legacy Gossamer Forums URLs -# version: 0.4 +# version: 0.5 # authors: saint@federated.computer # url: https://gitea.federated.computer/saint/discourse-legacy_links.git @@ -34,7 +34,8 @@ after_initialize do if post # Redirect to the post URL if found logger.info "[DEBUG] Redirecting to post with ID: #{post.id}" - redirect_to post_url(post) + # redirect_to post_url(post) + redirect_to_post(post) else # Return 404 if the post is not found logger.error "[ERROR] Post with original_gossamer_id #{post_id} not found" @@ -118,7 +119,7 @@ after_initialize do # Register custom routes to handle legacy URLs Discourse::Application.routes.append do - get '/forum/*path' => 'custom_post#index' + get '/forum/*path' => 'discourse_legacy_links/custom_post#index' end end end