Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title change should create new slug (and redirect the old slug) #57

Open
dentarg opened this issue Dec 14, 2016 · 1 comment
Open

Title change should create new slug (and redirect the old slug) #57

dentarg opened this issue Dec 14, 2016 · 1 comment

Comments

@dentarg
Copy link
Member

dentarg commented Dec 14, 2016

Example page: https://wiki.starkast.net/star_wars:_rogue_one_-_2017-12-28

In the old version of wikimum, we had page alias support. Maybe that could be use to solve title changes.

@dentarg
Copy link
Member Author

dentarg commented Dec 14, 2016

In the old version of wikimum, we had page alias support

def self.find_by_title(title = nil, user = nil)
return false if title.nil?
shorthand = title.to_shorthand
page = Page.find(:first,
:conditions => [ "shorthand_title = ? AND #{read_conditions_for(user)}", shorthand ],
:include => [ :permissions, :updater ])
unless page
page_alias = Alias.find(:first, :conditions => [ "alias = ?", shorthand ], :include => :page)
page = page_alias.page if page_alias
end
page
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant