Project

General

Profile

Updating wiki-to-overview for Redmine 2.x?

Added by Dan Wilcox almost 12 years ago

Howdy,

I was using the wiki-to-over plugin successfully in Redmine 1.3 and later with 1.4 using this fork. Essentially, it removes the Overview tab from the projects page and redirects to the Wiki, so the project start page aways lands on the Wiki.

It's pretty simple, the menu twiddling in wiki-to-overview/init.rb is:

Redmine::MenuManager.map :project_menu do |menu|
    menu.delete :overview
    wiki = menu.delete :wiki
    menu.push wiki.name, wiki.url, :param => wiki.param, :before => :activity
  end

Now I've upgraded my install to 2.2 stable and the Overview tab is still removed but the redirection dosen't work. I work mainly in C/C++/Objective-C/Java etc and have learned just enough Ruby to hack/fix broken Redmine plugins now and then, but I'm missing some inheritance understanding in how the following works in order to fix it.

In wiki-to-overview/app/controllers/projects_controller.rb:

class ProjectsController < ApplicationController
  unloadable

  before_filter :forward_to_wiki, :only => :show

  def forward_to_wiki
    redirect_to project_wiki_start_page_path params[:id]
    return false
  end
end

So as far as I can tell from reading the Redmine source, the plugin here is adding a hook to the Redmine projects_controller that should call forward_to_wiki whenever show is called to show the project overview. That makes sense. What I don't know is what has been changed between Redmine 1.x and 2.x in order for this to work.

Thanks in advance.