Defect #31141

SCM: error when *.yml and *.txt show

Added by Toshi MARUYAMA over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:-
Resolution:Fixed Affected version:

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.

fix-31141.patch Magnifier (6.57 KB) Mizuki ISHIKAWA, 2019-05-16 03:46

fix-31141-1.diff Magnifier (1.64 KB) Toshi MARUYAMA, 2019-05-28 16:09


Related issues

Related to Redmine - Defect #30850: Unified diff link broken on specific file/revision diff view Closed
Duplicated by Redmine - Defect #31478: RepositoriesController entry is missing a template for Image Closed

Associated revisions

Revision 18206
Added by Toshi MARUYAMA over 3 years ago

scm: early return in diff if diff is nil as same as show, changes, and etc. (#31141, #30850)

Contributed by Mizuki ISHIKAWA.

Revision 18207
Added by Toshi MARUYAMA over 3 years ago

add *.yaml and *.txt to RoutingRepositoriesTest (#31141, #30850)

Revision 18211
Added by Toshi MARUYAMA over 3 years ago

scm: fix error when *.yml and *.txt show (#31141, #30850)

Contributed by Mizuki ISHIKAWA.

History

#1 Updated by Go MAEDA over 3 years ago

  • Status changed from New to Confirmed

#2 Updated by Toshi MARUYAMA over 3 years ago

  • 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: []):

#3 Updated by Mizuki ISHIKAWA over 3 years ago

The problem is caused by r17962(#30850).

#4 Updated by Go MAEDA over 3 years ago

  • Related to Defect #30850: Unified diff link broken on specific file/revision diff view added

#5 Updated by Mizuki ISHIKAWA over 3 years ago

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]}

#6 Updated by Mizuki ISHIKAWA over 3 years ago

I have attached a patch to fix this problem.

#7 Updated by Go MAEDA over 3 years ago

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.

#8 Updated by Toshi MARUYAMA over 3 years ago

  • File fix-31141-1.diff added

This is additional tests.

#9 Updated by Toshi MARUYAMA over 3 years ago

  • File deleted (fix-31141-1.diff)

#10 Updated by Toshi MARUYAMA over 3 years ago

#11 Updated by Go MAEDA over 3 years ago

  • Duplicated by Defect #31478: RepositoriesController entry is missing a template for Image added

#12 Updated by Go MAEDA over 3 years ago

  • Status changed from Confirmed to Closed
  • Resolution set to Fixed

Fixed in r18206.

#13 Updated by Toshi MARUYAMA over 3 years ago

Thank you for your closing.

Also available in: Atom PDF