Defect #6388

New Subproject leads to a 404

Added by Holger Winkelmann about 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2010-09-14
Priority:NormalDue date:
Assignee:Eric Davis% Done:

0%

Category:Projects
Target version:1.0.2
Resolution:Fixed Affected version:

Description

Adding a New SubProject renders a 404.

- Actual trunk r4083
- Postgres 8.4

Associated revisions

Revision 4095
Added by Eric Davis about 7 years ago

Fix the new subproject link on project overview. #6388

Contributed by Felix Schäfer.

History

#2 Updated by Michael Hughes about 7 years ago

Same occurs on my server:

-redmine 1.0.1.devel
-mysql 14.12 Distrib 5.0.75 debian-linux-gnu
-ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]

#3 Updated by Felix Schäfer about 7 years ago

Michael Hughes wrote:

Same occurs on my server:

SubmittingBugs, in this case especially:

the error stack trace that you should find in the log file if your report is about an error. The message displayed by the app (eg. ...An error occurred on the page you were trying to access. If you continue...) is useless here.

#4 Updated by Perrier T about 7 years ago

SubmittingBugs, in this case especially:

the error stack trace that you should find in the log file if your report is about an error. The message displayed by the app (eg. ...An error occurred on the page you were trying to access. If you continue...) is useless here.

I've just updated to 4089 and it looks like this is a real issue.

Processing ProjectsController#show (for 192.168.0.123 at 2010-09-16 13:36:40) [GET]
  Parameters: {"action"=>"show", "id"=>"add", "parent_id"=>"bat", "controller"=>"projects"}
Rendering template within layouts/base
Rendering common/404 (404)
Filter chain halted as [:find_project] rendered_or_redirected.
Completed in 47ms (View: 47, DB: 0) | 404 Not Found [http://192.168.0.149/projects/add?parent_id=bat] 

I hope this is what you mean by log. If anything else could be useful I'll try to post it too.

#5 Updated by Felix Schäfer about 7 years ago

  • Assignee set to Eric Davis
  • Affected version (unused) set to devel

I've spotted the bug, thanks. There's some (somewhat heavy) refactoring going on in the controllers, and some routes change due to that. For the impatient, the hotfix is quite simple:

diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml
index 0ad9a11..cf3814b 100644
--- a/app/views/projects/show.rhtml
+++ b/app/views/projects/show.rhtml
@@ -1,6 +1,6 @@
 <div class="contextual">
        <% if User.current.allowed_to?(:add_subprojects, @project) %>
-               <%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'add', :parent_id => @project}, :class => 'icon icon-add' %>
+               <%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %>
        <% end %>
 </div>
 

For the git users among you, the commit can be found on github too.

#6 Updated by Eric Davis about 7 years ago

  • Status changed from New to Resolved
  • Target version set to 1.0.2
  • Resolution set to Fixed

Fixed in r4095. Thanks for the patch Felix.

#7 Updated by Eric Davis about 7 years ago

  • Status changed from Resolved to Closed

Merged into 1.0-stable for release in 1.0.2

#8 Updated by Roman aka iTUX about 7 years ago

redmine 1.0.3 - error still remains

Processing ProjectsController#show (for хх.хх.хх.хх at 2010-11-11 17:33:03) [GET]
Parameters: {"action"=>"show", "id"=>"add", "parent_id"=>"documenting", "controller"=>"projects"}
Rendering template within layouts/base
Rendering common/404 (404)
Filter chain halted as [:find_project] rendered_or_redirected.
Completed in 14ms (View: 0, DB: 10) | 404 Not Found [http://redmine/projects/add?parent_id=documenting]

#9 Updated by Gabriel Gomiz about 7 years ago

I can confirm that version 1.0.3 has the error. It is weird because I've checked and the patch is applied... :S

#10 Updated by Felix Schäfer about 7 years ago

Make sure you don't have any plugins installed overriding the view with the old/broken link.

#11 Updated by Charlie Beckett almost 7 years ago

I can confirm that the projects tree view plugin (http://www.redmine.org/boards/3/topics/4645) needs a subtle tweak to get this working.

Changing the related apps\index.rhtml file, action from 'add' to 'new' got my system up and running.

Also available in: Atom PDF