Project

General

Profile

Actions

Defect #31141

closed

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

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

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
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.


Files

fix-31141.patch (6.57 KB) fix-31141.patch Mizuki ISHIKAWA, 2019-05-16 03:46
fix-31141-1.diff (1.64 KB) fix-31141-1.diff Toshi MARUYAMA, 2019-05-28 16:09

Related issues

Related to Redmine - Defect #30850: Unified diff link broken on specific file/revision diff viewClosedJean-Philippe Lang

Actions
Has duplicate Redmine - Defect #31478: RepositoriesController entry is missing a template for ImageClosed

Actions
Actions #1

Updated by Go MAEDA over 5 years ago

  • Status changed from New to Confirmed
Actions #2

Updated by Toshi MARUYAMA over 5 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: []):
Actions #3

Updated by Mizuki ISHIKAWA over 5 years ago

The problem is caused by r17962(#30850).

Actions #4

Updated by Go MAEDA over 5 years ago

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

Updated by Mizuki ISHIKAWA over 5 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]}

Actions #6

Updated by Mizuki ISHIKAWA over 5 years ago

I have attached a patch to fix this problem.

Actions #7

Updated by Go MAEDA over 5 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.

Actions #8

Updated by Toshi MARUYAMA over 5 years ago

  • File fix-31141-1.diff added

This is additional tests.

Actions #9

Updated by Toshi MARUYAMA over 5 years ago

  • File deleted (fix-31141-1.diff)
Actions #10

Updated by Toshi MARUYAMA over 5 years ago

Actions #11

Updated by Go MAEDA over 5 years ago

  • Has duplicate Defect #31478: RepositoriesController entry is missing a template for Image added
Actions #12

Updated by Go MAEDA over 5 years ago

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

Fixed in r18206.

Actions #13

Updated by Toshi MARUYAMA over 5 years ago

Thank you for your closing.

Actions

Also available in: Atom PDF