alphanodes / additionals

Redmine plugin for easy customization of settings, text and content display by using personal or role-based dashboards (drag&drop), providing wiki macros and act as library for other plugins.
https://www.redmine.org/plugins/additionals
GNU General Public License v2.0
131 stars 43 forks source link

Cannot edit dashboard #137

Closed sibbi77 closed 2 years ago

sibbi77 commented 2 years ago

Similar to #109, but without any additional plugins.

  1. Create a new project "test"
  2. "Edit dashboard" takes me to the url "/projects/test/dashboards/2/edit"
  3. Click save
  4. The url is "/dashboards/2" and error is "The page you were trying to access doesn't exist or has been removed."

Shouldn't the url read "/projects/test/dashboards/2"?

I tried redmine 4.2.5, 4.2.6 and 4.1.7. Always a clean install from docker images. The database was completely removed between version changes.

I'm using the stable branch (version 3.0.5.2 7a56bff).

Here is the log:

redmine_1  | I, [2022-05-20T09:27:53.561410 #1]  INFO -- : Started GET "/projects/test/dashboards/2/edit" for 172.16.0.185 at 2022-05-20 09:27:53 +0000
redmine_1  | I, [2022-05-20T09:27:53.562355 #1]  INFO -- : Processing by DashboardsController#edit as HTML
redmine_1  | I, [2022-05-20T09:27:53.562425 #1]  INFO -- :   Parameters: {"project_id"=>"test", "id"=>"2"}
redmine_1  | I, [2022-05-20T09:27:53.611907 #1]  INFO -- :   Current user: admin (id=1)
redmine_1  | I, [2022-05-20T09:27:53.614670 #1]  INFO -- :   Rendering plugins/additionals/app/views/dashboards/edit.html.slim within layouts/base
redmine_1  | I, [2022-05-20T09:27:53.632584 #1]  INFO -- :   Rendered plugins/additionals/app/views/dashboards/_form.html.slim (17.3ms)
redmine_1  | I, [2022-05-20T09:27:53.633108 #1]  INFO -- :   Rendered plugins/additionals/app/views/dashboards/edit.html.slim within layouts/base (18.4ms)
redmine_1  | I, [2022-05-20T09:27:53.637258 #1]  INFO -- :   Rendered plugins/additionals/app/views/additionals/_html_head.html.slim (1.3ms)
redmine_1  | I, [2022-05-20T09:27:53.637672 #1]  INFO -- :   Rendered plugins/additionals/app/views/additionals/_body_top.slim (0.1ms)
redmine_1  | I, [2022-05-20T09:27:53.658638 #1]  INFO -- :   Rendered plugins/additionals/app/views/additionals/_body_bottom.html.slim (0.2ms)
redmine_1  | I, [2022-05-20T09:27:53.659077 #1]  INFO -- : Completed 200 OK in 97ms (Views: 37.0ms | ActiveRecord: 54.2ms)
redmine_1  | I, [2022-05-20T09:27:55.279490 #1]  INFO -- : Started PATCH "/dashboards/2" for 172.16.0.185 at 2022-05-20 09:27:55 +0000
redmine_1  | I, [2022-05-20T09:27:55.280494 #1]  INFO -- : Processing by DashboardsController#update as HTML
redmine_1  | I, [2022-05-20T09:27:55.280573 #1]  INFO -- :   Parameters: {"utf8"=>"✓", "authenticity_token"=>"GH1TaU/lzmTsR4F7ftJfoNxLr/2F78yF1hvDkT+JUsT7vXPy0TuHhpqk6eVMwUcXwJanBb5a8jCzMk/jB62HJg==", "dashboard"=>{"name"=>"Project dashboard", "description"=>"", "project_id"=>"1", "visibility"=>"2", "role_ids"=>[""], "enable_sidebar"=>"1", "always_expose"=>"0", "author_id"=>"1"}, "commit"=>"Save", "id"=>"2"}
redmine_1  | I, [2022-05-20T09:27:55.320157 #1]  INFO -- :   Current user: admin (id=1)
redmine_1  | I, [2022-05-20T09:27:55.321957 #1]  INFO -- :   Rendering common/error.html.erb within layouts/base
redmine_1  | I, [2022-05-20T09:27:55.322196 #1]  INFO -- :   Rendered common/error.html.erb within layouts/base (0.2ms)
redmine_1  | I, [2022-05-20T09:27:55.326174 #1]  INFO -- :   Rendered plugins/additionals/app/views/additionals/_html_head.html.slim (1.3ms)
redmine_1  | I, [2022-05-20T09:27:55.326513 #1]  INFO -- :   Rendered plugins/additionals/app/views/additionals/_body_top.slim (0.1ms)
redmine_1  | I, [2022-05-20T09:27:55.340412 #1]  INFO -- :   Rendered plugins/additionals/app/views/additionals/_body_bottom.html.slim (0.2ms)
redmine_1  | I, [2022-05-20T09:27:55.340633 #1]  INFO -- : Filter chain halted as :find_dashboard rendered or redirected
redmine_1  | I, [2022-05-20T09:27:55.340752 #1]  INFO -- : Completed 404 Not Found in 60ms (Views: 15.7ms | ActiveRecord: 39.6ms)
redmine@10b9e6112aed:/usr/src/redmine$ RAILS_ENV=production bin/about
W, [2022-05-20T09:35:19.738202 #58]  WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.
W, [2022-05-20T09:35:19.872146 #58]  WARN -- : Creating scope :sorted. Overwriting existing method User.sorted.
W, [2022-05-20T09:35:19.878593 #58]  WARN -- : Creating scope :sorted. Overwriting existing method Group.sorted.
W, [2022-05-20T09:35:19.929729 #58]  WARN -- : Creating scope :visible. Overwriting existing method Principal.visible.

sh: 1: cvs: not found
Environment:
  Redmine version                4.1.7.stable
  Ruby version                   2.6.10-p210 (2022-04-12) [x86_64-linux]
  Rails version                  5.2.6.3
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Subversion                     1.14.1
  Mercurial                      5.6.1
  Bazaar                         3.1.0
  Git                            2.30.2
  Filesystem                     
Redmine plugins:
  additionals                    3.0.5.2
redmine@10b9e6112aed:/usr/src/redmine$
alexandermeindl commented 2 years ago

Hi @sibbi77,

I cannot reproduce this problem. URL /dashboards/2 is correct for update the dashboard. Are you sure, there is no other active plugins or no modifications of Redmine routing?

sibbi77 commented 2 years ago

I tried hard to have a clean environment. Using docker containers and empty databases made me think I've a sane environment. How can I check for routing modifications?

sibbi77 commented 2 years ago

I tried the absolute minimal configuration: docker run -d --name redmine-docker-test -p 3003:3000 redmine:4.2.6 After docker exec -it redmine-docker-test bash I installed the plugin according to the documentation:

git clone -b stable https://github.com/AlphaNodes/additionals.git plugins/additionals
bundle config set --local without 'development test'
bundle install
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
kill 1

docker start redmine-docker-test

The problem remains reproducible.

alexandermeindl commented 2 years ago

Hi @sibbi77,

another look to source and I think I found the problem. It looks like a bug, if you only have 1 project in your Redmine (or access to one project). As you are using a user with admin permission, just try to create a second project. After the second project exist, it should work.

Let me know, if this is the problem. I'll create a bug fix then, to solve this problem.

sibbi77 commented 2 years ago

Great! You found it! After creating a second project, it works.

alexandermeindl commented 2 years ago

Hi @sibbi77

I'm glad this works now. Thanks for reporting this!

I commited a fix to main branch for it.