f0y / redmine_private_wiki

Private Wiki plugin for Redmine
http://www.redmine.org/plugins/private_wiki
MIT License
17 stars 16 forks source link

Error in redmine 2.3 #20

Closed majkinetor closed 11 years ago

majkinetor commented 11 years ago
ActionView::Template::Error (undefined method `private' for #):                                             
    1: <% if controller and controller.class.name == 'WikiController' and controller.action_name == "show" and                         
    2:         @page and @page.id and @page.visible? %>                                                                                
    3:                                                                                                                                 
    4:     <%= link_to_if_authorized(l(:button_hide_wiki), {:action => 'change_privacy', :id => @page.title, :private => 1}, :method =>
 :post, :class => 'icon icon-hide') if !@page.private? %>                                                                              
    5:     <%= link_to_if_authorized(l(:button_reveal_wiki), {:action => 'change_privacy', :id => @page.title, :private => 0}, :method 
=> :post, :class => 'icon icon-reveal') if @page.private? %>                                                                           
  lib/redmine/hook.rb:111:in `block in render_on'                                                                                      
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'                                                                            
  lib/redmine/hook.rb:61:in `each'                                                                                                     
  lib/redmine/hook.rb:61:in `block in call_hook'                                                                                       
  lib/redmine/hook.rb:58:in `tap'                                                                                                      
  lib/redmine/hook.rb:58:in `call_hook'                                                                                                
  lib/redmine/hook.rb:158:in `call_hook'                                                                                               
  app/views/layouts/base.html.erb:75:in `_app_views_layouts_base_html_erb___3045660557403982530_62662640'                              
  app/controllers/wiki_controller.rb:99:in `show'  

EDIT:

For some reason migration didn't go?! I had to manually add column to wiki_pages

f0y commented 11 years ago

You have to run migration for plugin. As noted in README

majkinetor commented 11 years ago

I did, somehow it didn't do anything, its behaving like its already having that migration installed.. I had it previously installed, then uninstalled, a year ago.

The new problem is that after hiding/restoring page I am redirected to blank screen where project name is added after the wiki like this.

http://redmine .... /my_project/wiki.my_project

It looks like something is bad with installation and I can reveret migration or add it the usual way.

How could I force removal and reinstall again?

ghost commented 11 years ago

majkinetor, _bundle exec rake redmine:plugins NAME=redmine_private_wiki VERSION=0 RAILSENV=production

But it will not help. :) I also have this issue with redmine 2.3 when redirecting to wiki.Page instead of wiki/Page

ghost commented 11 years ago

So as I see _redirect_to project_wikipath(@project, @page.title)

need to be changed to

_redirect_to project_wiki_pagepath(@project, @page.title)

at redmine_private_wiki/lib/private_wiki/wiki_controller_patch.rb

f0y commented 11 years ago

Can you create a pull request with some tests covering this bug?

On Thu, Apr 18, 2013 at 2:07 PM, Slava Komarov notifications@github.comwrote:

So as I see _redirect_to project_wikipath(@project https://github.com/project, @page.title)

need to be changed to

_redirect_to project_wiki_pagepath(@project https://github.com/project, @page.title)

at redmine_private_wiki/lib/private_wiki/wiki_controller_patch.rb

— Reply to this email directly or view it on GitHubhttps://github.com/f0y/redmine_private_wiki/issues/20#issuecomment-16568100 .

Best Wishes, Oleg Kandaurov

ghost commented 11 years ago

Oleg, I would be glad to do it, but I'm a not ruby developer, just a system administrator. So I have a lack of knowledge in it.

f0y commented 11 years ago

Ок, fine. Is this a proven solution? In other words, does your solution work?

On Thu, Apr 18, 2013 at 2:22 PM, Slava Komarov notifications@github.comwrote:

Oleg, I would be glad to do it, but I'm a not ruby developer, just a system administrator. So I have a lack of knowledge in it.

— Reply to this email directly or view it on GitHubhttps://github.com/f0y/redmine_private_wiki/issues/20#issuecomment-16568672 .

Best Wishes, Oleg Kandaurov

ghost commented 11 years ago

Yes, it works fine with renaming to project_wiki_page_path. I simple grep'ed redmine directory and did not find anything like _project_wikipath, but only _project_wiki_pagepath, so I thought that it should work for redmine_private_wiki. :) Thanks for your plugin. It's useful. Spasibo :)

f0y commented 11 years ago

nezachto =)

On Thu, Apr 18, 2013 at 2:28 PM, Slava Komarov notifications@github.comwrote:

Yes, it works fine with renaming to project_wiki_page_path. I simple grep'ed redmine directory and did not find anything like project_wikipath, but only project_wiki_pagepath, so I thought that it should work for redmine_private_wiki. :) Thanks for your plugin. It's useful. Spasibo :)

— Reply to this email directly or view it on GitHubhttps://github.com/f0y/redmine_private_wiki/issues/20#issuecomment-16568917 .

Best Wishes, Oleg Kandaurov

cforce commented 11 years ago

You are welcome!