Had the same issue with my Redmine plugin, after hours of digging and research found out what appears to be the issue. What is important is to update the @project variable with project id parameter passed into your show method. Here is my controller file:
class YearlyController < ApplicationController
unloadable
helper :issues
include IssuesHelper
def show
require_login
@project = Project.find(params[:project_id])
end
end
And init.rb file:
Redmine::Plugin.register :weekly do
name 'Weekly Plan plugin'
description 'Display weekly plan for current and previous week'
version '0.0.2'
menu :project_menu, :yearly, { :controller => 'yearly', :action => 'show' }, :caption => 'Roadmap Year', :after => :overview, :param => :project_id
menu :project_menu, :weekly, { :controller => 'weekly', :action => 'show' }, :caption => 'Weekly Plan', :after => :yearly, :param => :project_id
settings :default => { :weeklabel_name => 'Weekly Label' }, :partial => 'settings/settings'
project_module :weekly do
permission :view_weekly, :weekly => :show
permission :view_yearly, :yearly => :show
end
end