danmunn / redmine_dmsf

Fork of svn repository for redmine_dmsf
GNU General Public License v2.0
413 stars 193 forks source link

Problem clicking action menu (three dots) in DMS file grid #1501

Closed Elkropac closed 5 months ago

Elkropac commented 5 months ago

Hello, customer is running redmine in docker container. Current environment is

Environment:
  Redmine version                5.1.1.stable
  Ruby version                   3.1.4-p223 (2023-03-30) [x86_64-linux]
  Rails version                  6.1.7.6
  Environment                    production
  Database adapter               SQLite
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Alternate
SCM:
  Subversion                     1.14.2
  Mercurial                      6.3.2
  Bazaar                         3.3.2
  Git                            2.39.2
  Filesystem                     
Redmine plugins:
  redmine_dmsf                   3.1.3

Recently, they started to have problem with action popup in DMS file grid. When they click on three dots next to file, they get this exception in redmine log and no menu pop's up


I, [2024-01-09T14:34:25.906732 #1]  INFO -- : Started GET "/projects/dmsf/context_menu?utf8=%E2%9C%93&authenticity_token=token&back_url=%2Fprojects%2Fea%2Fdmsf&c%5B%5D=id&c%5B%5D=title&c%5B%5D=size&c%5B%5D=modified&c%5B%5D=version&c%5B%5D=workflow&c%5B%5D=author&c%5B%5D=description&ids%5B%5D=file-47" for x.x.x.x at 2024-01-09 14:34:25 +0000
I, [2024-01-09T14:34:25.908873 #1]  INFO -- : Processing by DmsfContextMenusController#dmsf as */*
I, [2024-01-09T14:34:25.908984 #1]  INFO -- :   Parameters: {"utf8"=>"✓", "authenticity_token"=>"token", "back_url"=>"/projects/ea/dmsf", "c"=>["id", "title", "size", "modified", "version", "workflow", "author", "description"], "ids"=>["file-47"]}
I, [2024-01-09T14:34:25.913261 #1]  INFO -- :   Current user: admin (id=1)
I, [2024-01-09T14:34:25.928081 #1]  INFO -- :   Rendered plugins/redmine_dmsf/app/views/dmsf_context_menus/dmsf.html.erb (Duration: 4.8ms | Allocations: 4159)
I, [2024-01-09T14:34:25.928232 #1]  INFO -- : Completed 500 Internal Server Error in 19ms (ActiveRecord: 1.7ms | Allocations: 8619)
F, [2024-01-09T14:34:25.929001 #1] FATAL -- :
ActionView::Template::Error (undefined method `zero?' for nil:NilClass

    last_revision.minor_version.zero? if Setting.plugin_redmine_dmsf['only_approval_zero_minor_version']
                               ^^^^^^):
    22: <% wf = DmsfWorkflow.find_by(id: dmsf_file.last_revision.dmsf_workflow_id) if dmsf_file.last_revision.dmsf_workflow_id %>
    23: <% file_approval_allowed = User.current.allowed_to?(:file_approval, project) %>
    24: <% allowed = User.current && (dmsf_file.last_revision.dmsf_workflow_assigned_by_user == User.current) && wf %>
    25: <% allowed_minor = dmsf_file.approval_allowed_zero_minor %>
    26:
    27: <% if file_approval_allowed %>
    28:   <% case dmsf_file.last_revision.workflow %>

plugins/redmine_dmsf/app/models/dmsf_file.rb:122:in `approval_allowed_zero_minor'
plugins/redmine_dmsf/app/views/dmsf_context_menus/_approval_workflow.html.erb:25
plugins/redmine_dmsf/app/views/dmsf_context_menus/_file.html.erb:66
plugins/redmine_dmsf/app/views/dmsf_context_menus/dmsf.html.erb:23
plugins/redmine_dmsf/app/controllers/dmsf_context_menus_controller.rb:70:in `dmsf'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
plugins/redmine_dmsf/lib/redmine_dmsf/webdav/custom_middleware.rb:56:in `call'

Is there a way to fix this?

I have just edited the issue, because i have pasted wrong log

picman commented 5 months ago

Yes, that's a bug. As a workaround you can switch off Only approval zero minor version option, use the devel branch or wait for the next release which will be released soon.