dr-itz / redmine_workflow_enhancements

Redmine workflow enhancements. UNMAINTAINED
GNU General Public License v2.0
27 stars 29 forks source link

responding with 404 #1

Closed codyliou closed 10 years ago

codyliou commented 10 years ago

HI,

link Administration -> Workflow is 404 Error

Processing by WorkflowsController#edit as HTML Current user: cody (id=3) Rendered plugins/redmine_workflow_enhancements/app/views/workflows/edit.html.erb within layouts/admin (213.4ms) Missing template, responding with 404 Rendered common/error.html.erb within layouts/cms (1.0ms)

dr-itz commented 10 years ago

What version of Redmine and Ruby is this? (So far, I only tested with Redmine 2.5/trunk on Ruby 2.0)

dr-itz commented 10 years ago

Meanwhile I tested the following combinations:

Do you have any other plugins installed?

codyliou commented 10 years ago

Environment: Redmine version 2.5.2.stable Ruby version 2.0.0-p247 (2013-06-27) [i386-mingw32] Rails version 3.2.19 Environment production Database adapter Mysql2 SCM: Subversion 1.8.3 Mercurial 3.0.1 Git 1.8.4 Filesystem
Redmine plugins: author_adder 0.0.1 clipboard_image_paste 1.8 enhanced_queries 0.2 issues_custom_relations 0.0.1 manage_wiki_view_page_permission 0.0.1 progressive_projects_list 1.0.0 projects_table 0.0.1 quick_edit 0.0.1 redmine_assign_resources 1.0.0 redmine_cms 0.0.3 redmine_dashboard 2.2.4 redmine_evm 1.0.0 redmine_image_clipboard_paste 1.0.0 redmine_improved_subtasks 0.0.1 redmine_issue_tabs 0.0.1 redmine_issuepoke 0.0.1 redmine_issues_poll 0.2.0 redmine_maintenance_mode 1.0.0 redmine_mentions 0.0.1 redmine_responsibility_list 1.0.0 redmine_wktime 1.6 redmine_work_time 0.2.15 redmine_workflow_enhancements 0.1.1 redmine_workload 0.0.1 redmine_workload_calendar 0.1 systango_hrm 1.0.0 version_time_control 1.1.0

dr-itz commented 10 years ago

Thanks. The main difference seems to be that you're using Windows. I don't have a Windows box available now, but will have next week when I'm at work...I'll look into it then.

dr-itz commented 10 years ago

So I found an ancient Windows XP VM, installed Ruby 2.0.0-p481, Redmine and my plugin...and it works. This is the environment:

Environment:
  Redmine version                2.5.2.devel
  Ruby version                   2.0.0-p481 (2014-05-08) [i386-mingw32]
  Rails version                  3.2.19
  Environment                    development
  Database adapter               PostgreSQL
SCM:
  Git                            1.7.7.1
  Filesystem                     
Redmine plugins:
  redmine_workflow_enhancements  0.1.1

I also tried Ruby 2.0.0-p247. Works as well.

Maybe it breaks on newer Windows...I'll test that next week. What version of Windows are you on?

Or it could actually be an interaction with one of the many plugins you have. You could try to narrow it down:

If you find the plugin that breaks stuff, tell me and I'll look into it.

jonvargas commented 10 years ago

Same happens for me but on Ubuntu 14.04, even after disabling all other plugins:

Environment:
  Redmine version                2.5.2.stable.13335
  Ruby version                   1.9.3-p484 (2013-11-22) [x86_64-linux]
  Rails version                  3.2.19
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.8
  Git                            1.9.1
  Filesystem                     
Redmine plugins:
  redmine_ics_export             3.0.0.dev
  redmine_knowledgebase          3.0.4
  redmine_login_audit            0.1.5
  redmine_timesheet_plugin       0.7.0
  redmine_workflow_enhancements  0.2.0

Error on production.log:

Started GET "/workflows/edit" for 192.168.1.3 at 2014-08-22 15:11:49 -0600
Processing by WorkflowsController#edit as HTML
  Current user: jvargas (id=3)
  Rendered plugins/redmine_workflow_enhancements/app/views/workflows/edit.html.erb within layouts/admin (2.9ms)
Missing template, responding with 404
  Rendered common/error.html.erb within layouts/base (0.2ms)
  Rendered inline template (0.8ms)
Completed 404 Not Found in 208.4ms (Views: 190.1ms | ActiveRecord: 3.6ms)

After disabling plugins:

Environment:
  Redmine version                2.5.2.stable.13335
  Ruby version                   1.9.3-p484 (2013-11-22) [x86_64-linux]
  Rails version                  3.2.19
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.8
  Git                            1.9.1
  Filesystem                     
Redmine plugins:
  redmine_workflow_enhancements  0.2.0
dr-itz commented 10 years ago

@jonvargas thanks for the report. I have no idea what's going on. Could you try to add a bit of debbuging code? Change app/helpers/workflow_enhancements_helper.rb, so it looks like this:

module WorkflowEnhancementsHelper
  def render_super(current_path)
    details = lookup_context.registered_details.inject({}) do |h, n|
      h[n] = lookup_context.send(n); h
    end
    details[:locale] = [details[:locale]] unless details[:locale].is_a? Array

    base = File.basename(current_path).split('.').first
    Rails.logger.warn("base: " + base)
    prefix = lookup_context.prefixes.first
    Rails.logger.warn("prefix: " + prefix)
    parent_views = view_paths.map do |path|
      all = path.find_all(base, prefix, false, details)
      all.each {|a| Rails.logger.warn("for path: " + path.inspect + ", found: " + a.inspect) }
      first = all.first.try(:identifier)
      Rails.logger.warn("first: " + first.inspect) if first
      first
    end.delete_if {|path| !path || path == current_path}

    parent_views.each {|v| Rails.logger.warn("parent_view: " + v.inspect) }
    render :file => parent_views.first.split('.').first
  end
end
dr-itz commented 10 years ago

I implemented (well, mostly copied) another approach of rendering the super template. Could you guys test that? I pushed it to a branch 'render-super', so:

cd plugins/redmine_workflow_enhancements
git pull
git checkout render-super
cylien commented 10 years ago

I have the same problem when I edit redmine/workflows/edit. By the way, it's doesn't work to clone the branch 'render-super' for me.

the log:

Started GET "/redmine/workflows/edit" for XXX.XXX.XXX.X at 2014-08-29 23:52:52 +0800
Processing by WorkflowsController#edit as HTML
  Current user: cylien (id=1)
  Rendered plugins/redmine_workflow_enhancements/app/views/workflows/edit.html.erb within layouts/admin (15.4ms)
Missing template, responding with 404

my redmine's environment:

Environment:
  Redmine version                2.4.1.stable
  Ruby version                   1.9.3-p484 (2013-11-22) [i686-linux]
  Rails version                  3.2.15
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.4
  Git                            1.8.3
  Filesystem                     
Redmine plugins:
  clipboard_image_paste          1.8
  readme_at_repositories         0.2.1
  redcase                        1.0 beta 2.0
  redmine_add_subversion_links   0.3.0
  redmine_agile                  1.2.0-light
  redmine_better_gantt_chart     0.9.0
  redmine_close_button           0.0.8
  redmine_code_review            0.6.3
  redmine_codebutton             0.0.1
  redmine_custom_css             0.1.4
  redmine_dmsf                   1.4.8 stable
  redmine_github_hook            0.2.0
  redmine_idonethis              0.1
  redmine_issue_checklist        2.0.5
  redmine_issue_templates        0.0.8
  redmine_people                 0.1.8
  redmine_redcarpet_formatter    2.1
  redmine_screenshot_paste       2.1.0
  redmine_spent_time             2.6.5
  redmine_theme_changer          0.1.0
  redmine_workflow_enhancements  0.2.0
dr-itz commented 10 years ago

@cylien Here's how to check out the render-super branch:

daniel@macritz3 ~/redmine/plugins$ git clone https://github.com/dr-itz/redmine_workflow_enhancements.git
Cloning into 'redmine_workflow_enhancements'...
remote: Counting objects: 242, done.
remote: Compressing objects: 100% (119/119), done.
remote: Total 242 (delta 83), reused 237 (delta 81)
Receiving objects: 100% (242/242), 103.05 KiB | 0 bytes/s, done.
Resolving deltas: 100% (83/83), done.
Checking connectivity... done.
daniel@macritz3 ~/redmine/plugins$ cd redmine_workflow_enhancements
daniel@macritz3 ~/redmine/plugins/redmine_workflow_enhancements$ git checkout render-super
Branch render-super set up to track remote branch render-super from origin.
Switched to a new branch 'render-super'
daniel@macritz3 ~/redmine/plugins/redmine_workflow_enhancements$

i.e. it's those commands:

dr-itz commented 10 years ago

Could someone try the 'render-super' branch, please?

cylien commented 10 years ago

@dr-itz thanks a lot. I have re-installed the branch 'render-super' and it works perfect now.

jonvargas commented 10 years ago

I haven't had enough time for testing, but it's nice to know that it does work for Chung.

2014-09-01 19:09 GMT-06:00 Chung-Yueh Lien notifications@github.com:

@dr-itz https://github.com/dr-itz thanks a lot. I have re-installed the branch 'render-super' and it works perfect now.

— Reply to this email directly or view it on GitHub https://github.com/dr-itz/redmine_workflow_enhancements/issues/1#issuecomment-54100404 .

Jonathan Vargas Rodríguez CEO and Business Developent Alkaid · Open Source Business Software http://alkaid.cr T: 4001 6259 Ext. 01 M: 4001 6259 Ext. 51 G: plus.google.com/+JonathanVargas E: jvargas@alkaid.cr

jonvargas commented 10 years ago

Now I tested it and it works.

2014-09-01 21:03 GMT-06:00 Jonathan Vargas jvargas@alkaid.cr:

I haven't had enough time for testing, but it's nice to know that it does work for Chung.

2014-09-01 19:09 GMT-06:00 Chung-Yueh Lien notifications@github.com:

@dr-itz https://github.com/dr-itz thanks a lot. I have re-installed the

branch 'render-super' and it works perfect now.

— Reply to this email directly or view it on GitHub https://github.com/dr-itz/redmine_workflow_enhancements/issues/1#issuecomment-54100404 .

Jonathan Vargas Rodríguez CEO and Business Developent Alkaid · Open Source Business Software http://alkaid.cr T: 4001 6259 Ext. 01 M: 4001 6259 Ext. 51 G: plus.google.com/+JonathanVargas E: jvargas@alkaid.cr

Jonathan Vargas Rodríguez CEO and Business Developent Alkaid · Open Source Business Software http://alkaid.cr T: 4001 6259 Ext. 01 M: 4001 6259 Ext. 51 G: plus.google.com/+JonathanVargas E: jvargas@alkaid.cr

dr-itz commented 10 years ago

Thanks for testing!

I merged the branch 'render-super' into master now.