Reviewable View Full Conversation broken on subfolder installs

On the Reviewable list, the view full conversation button does not work on sub-folder installs as it places the sub-folder in the URL twice.

I believe the issue happens here, though I’m not 100% sure why (other than maybe the base_url and the relative_url both include the sub-folder)

e class="onebox githubblob" data-onebox-src="https://github.com/discourse/discourse/blob/743ce093a952d42d514e6892f134d08fe88db350/lib/reviewable/conversation.rb#L23">
github.com/discourse/discourse

lib/reviewable/conversation.rb


      
  1. @id = post.id
  2. @excerpt = FlagQuery.excerpt(post.cooked)
  3. end
  4. end
  5. attr_reader :id, :permalink, :has_more, :conversation_posts
  6. def initialize(meta_topic)
  7. @id = meta_topic.id
  8. @has_more = false
  9. @permalink = "#{Discourse.base_url}#{meta_topic.relative_url}"
  10. @posts = []
  11. meta_posts = meta_topic.ordered_posts.where(post_type: ::Post.types[:regular]).limit(2)
  12. @conversation_posts = meta_posts.map { |mp| Reviewable::Conversation::Post.new(mp) }
  13. @has_more = meta_topic.posts_count > 2
  14. end
  15. end
  16. end

Clicking on it leads to a “Oops this page doesn’t exist or is private page to load”.

Screenshot showing duplicate sub-folder in path

「いいね!」 4

Maybe @eviltrout can have a look Monday.

「いいね!」 6

@eviltrout I think that should do it:

「いいね!」 4

I confirmed @j.jaffeux’s fix and merged it. Should be good now! Thanks.

「いいね!」 6