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

Problem with constants already initialized #21

Open
pedrofigueiredojs opened this issue Feb 3, 2021 · 2 comments
Open

Problem with constants already initialized #21

pedrofigueiredojs opened this issue Feb 3, 2021 · 2 comments

Comments

@pedrofigueiredojs
Copy link

Hi Haru, I'm having problems using your plug-in and they give me these warnings, but I don't understand much, can you help me?

image

@Tab10id
Copy link

Tab10id commented May 12, 2021

in init.rb need replace

Dir::foreach(File.join(File.dirname(__FILE__), 'lib')) do |file|
  next unless /\.rb$/ =~ file
  require file
end

to

Dir::foreach(File.join(File.dirname(__FILE__), 'lib')) do |file|
  next unless /\.rb$/ =~ file
  require_dependency file
end

and remove from wiki_extensins_applications_hooks.rb

require 'redmine'
require 'application_helper'

Routes deprecation warnings also from this plugin.
Not sure for 100% about this but looks good for me:
routes.rb

resources :projects, only: [] do
  resources :wiki_extensions, only: [] do
    collection do
      post :add_comment
      post :reply_comment
      get :tag
      get :forward_wiki_page
      post :destroy_comment
      post :update_comment
      post :vote
    end
  end

  resource :wiki_extensions_settings, only: %i[create update]
end

wiki_extensions_settings_controller.rb

# add:
def create
  update
end

# delete:
def find_project
  # ...
end

# replace before_action :find_project, :authorize, :find_user to
before_action :find_project_by_project_id, :authorize, :find_user

wiki_extensions_controller.rb

# delete:
def find_project
  # ...
end

# replace before_action :find_project, :authorize, :find_user to
before_action :find_project_by_project_id, :authorize, :find_user

@Tab10id
Copy link

Tab10id commented May 12, 2021

Also there a problem with WikiExtensionsFormatterPatch and WikiExtensions::Emoticons.
Should be moved to another directory and required by require for normal code reloading in development environment.
https://stackoverflow.com/a/29710188/3704748

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

No branches or pull requests

2 participants