From 155538ad660daae6e253b0e8490550ef94cf3845 Mon Sep 17 00:00:00 2001
From: Takashi Kato <tohosaku@users.osdn.me>
Date: Sat, 25 Oct 2025 10:09:35 +0900
Subject: [PATCH] Update propshaft to 1.3

---
 Gemfile                           | 2 +-
 app/helpers/application_helper.rb | 6 ++++--
 lib/redmine/asset_path.rb         | 8 ++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Gemfile b/Gemfile
index 41ecfab30d..5dcda9c6da 100644
--- a/Gemfile
+++ b/Gemfile
@@ -14,7 +14,7 @@ gem 'i18n', '~> 1.14.1'
 gem 'rbpdf', '~> 1.21.4'
 gem 'addressable'
 gem 'rubyzip', '~> 3.1.1'
-gem 'propshaft', '~> 1.1.0'
+gem 'propshaft', '~> 1.3.0'
 gem 'rack', '>= 3.1.3'
 gem "stimulus-rails", "~> 1.3"
 gem "importmap-rails", "~> 2.0"
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 1bdc29d81b..8839605403 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1744,7 +1744,8 @@ module ApplicationHelper
   #   stylesheet_link_tag('styles', :plugin => 'foo) # => picks styles.css from plugin's assets
   #
   def stylesheet_link_tag(*sources)
-    options = sources.last.is_a?(Hash) ? sources.pop : {}
+    # option keys is converted to a string in Propshaft::Helper.
+    options = sources.last.is_a?(Hash) ? sources.pop.symbolize_keys : {}
     plugin = options.delete(:plugin)
     sources = sources.map do |source|
       if plugin
@@ -1778,7 +1779,8 @@ module ApplicationHelper
   #   javascript_include_tag('scripts', :plugin => 'foo) # => picks scripts.js from plugin's assets
   #
   def javascript_include_tag(*sources)
-    options = sources.last.is_a?(Hash) ? sources.pop : {}
+    # option keys is converted to a string in Propshaft::Helper.
+    options = sources.last.is_a?(Hash) ? sources.pop.symbolize_keys : {}
     if plugin = options.delete(:plugin)
       sources = sources.map do |source|
         if plugin
diff --git a/lib/redmine/asset_path.rb b/lib/redmine/asset_path.rb
index 4c7959a587..599c479e8b 100644
--- a/lib/redmine/asset_path.rb
+++ b/lib/redmine/asset_path.rb
@@ -135,7 +135,11 @@ module Redmine
     def initialize(config, compilers)
       @extension_paths    = config.redmine_extension_paths
       @default_asset_path = config.redmine_default_asset_path
-      super(config.paths, compilers: compilers, version: config.version)
+      super(config.paths,
+            compilers: compilers,
+            version: config.version,
+            file_watcher: config.file_watcher,
+            integrity_hash_algorithm: config.integrity_hash_algorithm)
     end
 
     def asset_files
@@ -172,7 +176,7 @@ module Redmine
       @cache_sweeper ||= begin
         exts_to_watch  = Mime::EXTENSION_LOOKUP.map(&:first)
         files_to_watch = Array(all_paths).to_h { |dir| [dir.to_s, exts_to_watch] }
-        Rails.application.config.file_watcher.new([], files_to_watch) do
+        @file_watcher.new([], files_to_watch) do
           clear_cache
         end
       end
-- 
2.47.3

