Diff view for .js files in repositories is broken
|Assignee:||Go MAEDA||% Done:|
Redmine version 4.0.5.stable
Ruby version 2.6.3-p62 (2019-04-16) [x86_64-linux]
Rails version 5.2.3
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
Diff view for .js files in repositories is broken (#32449).
Patch by Mizuki ISHIKAWA.
#1 Updated by Samuel Monsarrat 5 months ago
We have the same problem with a GIT or SVN backend.
All other file types seem ok:
But the diff view is not :
#4 Updated by Mizuki ISHIKAWA 5 months ago
When displaying the js file, base.html.erb was not used as the layout file.
Specifying an explicit layout file as shown below should solve the problem.
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 269bc70a0..8350b4d48 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -269,7 +269,7 @@ class RepositoriesController < ApplicationController @changeset = @repository.find_changeset_by_name(@rev) @changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil @diff_format_revisions = @repository.diff_format_revisions(@changeset, @changeset_to) - render :diff, :formats => :html + render :diff, :formats => :html, :layout => 'base.html.erb' end end