hicknhack-software / redmine_hourglass

New Redmine plugin to enhance the time tracking abilities, reports and REST-API.
Other
78 stars 30 forks source link

NoMethodError: undefined method 'digest_path' for nil:NilClass #154

Open abcskif opened 2 years ago

abcskif commented 2 years ago

Hey guys!

Please help with following error

image_2021-11-16_19-48-16

Redmine version: 4.2.3.stable Plugin version: 1.2.0-beta5 Other plugins installed: Redmine Tags plugin (Light version) 2.0.11 Operating system: ubuntu focal on docker

ckieschnick commented 2 years ago

I could track down the basic issue for you. The recent release of sprocket-rails 3.3.0 and later introduce a change in the asset pipeline which results in your mentioned problem (there are some more issues connected to this).

Pinning sprockets-rails to 3.2.2 in the plugin/redmine Gemfile resolves the issue in my test setup at least for the asset precompile step and may serve as hotfix. I hadn't have the time to check if everything else is working. In the long term (depending how the asset compiling is handled in sprockets-rails/sprockets) we may need to overhaul the asset compilation to prevent pinning.

abcskif commented 2 years ago

Thanks a lot, it help!

magefan commented 2 years ago

As a temporary quick fix for us, we've changed the file:

plugins/redmine_hourglass/lib/hourglass/assets.rb

and replaced the line

File.join '..', Rails.env.production? ? instance.find_asset(path).digest_path : File.join(asset_directory_map[options[:type]] || '', path)

with

File.join '..', Rails.env.production? ? File.join(asset_directory_map[options[:type]] || '', path) : File.join(asset_directory_map[options[:type]] || '', path)
thomst commented 2 years ago

We had the same issue with Redmine 4.1.7 and Hourglass 1.2.0-rc1.

The solution of @magefan worked. Thank you.