Skip to content

Commit

Permalink
Fixes publiclab#6173. Powertag pages for activity () can use the ':va…
Browse files Browse the repository at this point in the history
…lue'
  • Loading branch information
Karska-dev committed Oct 20, 2020
1 parent 7db01b3 commit abb39fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/tag_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def index
def show
if params[:id].is_a? Integer
@wiki = Node.find(params[:id])&.first
elsif params[:id].match(':')
tagname = params[:id].match('[^:]*$')
@wiki = Node.where(slug: "#{tagname}").try(:first)
else
@wiki = Node.where(path: "/wiki/#{params[:id]}").try(:first) || Node.where(path: "/#{params[:id]}").try(:first)
@wiki = Node.where(slug: @wiki.power_tag('redirect'))&.first if @wiki&.has_power_tag('redirect') # use a redirected wiki page if it exists
Expand Down

0 comments on commit abb39fc

Please sign in to comment.