Defect #31141
closed
SCM: error when *.yml and *.txt show
Added by Toshi MARUYAMA over 5 years ago.
Updated over 5 years ago.
Description
lib/redmine/sudo_mode.rb:65:in `sudo_mode'
Started GET "/test-trunk/projects/test01/repository/18/entry/test00.yml" for 127.0.0.1 at 2019-04-04 15:41:16 +0900
Processing by RepositoriesController#entry as YAML
Parameters: {"id"=>"test01", "repository_id"=>"18", "path"=>"test00.yml"}
Current user: admin (id=1)
Completed 406 Not Acceptable in 295ms (ActiveRecord: 144.4ms)
ActionController::UnknownFormat (RepositoriesController#entry is missing a template for this request format and variant.
request.formats: ["application/x-yaml"]
request.variant: []):
This error is in only tunk, not in 4.0-stable.
Files
- Status changed from New to Confirmed
- Subject changed from SCM: error when *.yml shows to SCM: error when *.yml and *.txt show
*.txt also causes error.
lib/redmine/sudo_mode.rb:65:in `sudo_mode'
Started GET "/test-trunk/projects/redmine-bb-all/repository/15/entry/test/fixtures/files/japanese-utf-8.txt" for 127.0.0.1 at 2019-04-30 01:52:34 +0900
Processing by RepositoriesController#entry as TEXT
Parameters: {"id"=>"redmine-bb-all", "repository_id"=>"15", "path"=>"test/fixtures/files/japanese-utf-8.txt"}
Current user: admin (id=1)
Completed 406 Not Acceptable in 343ms (ActiveRecord: 157.4ms)
ActionController::UnknownFormat (RepositoriesController#entry is missing a template for this request format and variant.
request.formats: ["text/plain"]
request.variant: []):
- Related to Defect #30850: Unified diff link broken on specific file/revision diff view added
By changing to format: false, in the case of request like "/test-trunk/projects/redmine-bb-all/repository/15/entry/test/fixtures/files/japanese-utf-8.txt", the end ".txt" is interpreted as the format.
I think that the exception was caused by not being found even if you look for the view file like entry.text.
exception message:
ActionView::MissingTemplate: Missing template repositories/entry, application/entry with {:locale=>[:en], :formats=>[:text], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :rsb]}
I have attached a patch to fix this problem.
Mizuki ISHIKAWA wrote:
I have attached a patch to fix this problem.
I have confirmed that the patch fixes the issue. Tested with yml, txt, and gif files.
- File fix-31141-1.diff added
This is additional tests.
- File deleted (
fix-31141-1.diff)
- Has duplicate Defect #31478: RepositoriesController entry is missing a template for Image added
- Status changed from Confirmed to Closed
- Resolution set to Fixed
Thank you for your closing.
Also available in: Atom
PDF