Project

General

Profile

why does plug-in "widget" not working?

Added by sean chan over 14 years ago

I download a plug-in named "widget" from the plugin-list "http://www.redmine.org/wiki/redmine/Plugin_List#My-Widgets-plugin"
1:
I placed it in the directory of \vendor\plugins,and renamed it as 'redmine_my_widgets'
2:
I add the page name to the "view\my\block\my_controller.rb" file ,'custom_queries'=> :label_***,.....
3:
I restart redmine,and I can see the plugin in "admin\plugins"
I can see the function I added in the block,but when I click the "add" button , it becomes an error

one of these functions I was trying to add to the "my/page_layout.rhtml" is "project_issues_cloud",and the error is like
"undefined method 'roles' for #<Member:...
Extracted source(around line #2)
1:<%
2: projects = User.current.memberships.collect{|m| m.project if m.roles.each{|role| role.allowed_to?(:view_issues)}}
.......
"

I checked the model "member",and I found out that "member belongs to role"!!!
why is that happening?
has the data structure of RedMine been changed? or just because I'm not using this plug-in in the right way?
thanks for help.......:)