From cd9a51ba4244792a060539af243893db6be81ec5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 11:52:22 +0000 Subject: [PATCH 1/3] build(deps): bump sablon from 0.3.2 to 0.4.3 Bumps [sablon](https://github.com/senny/sablon) from 0.3.2 to 0.4.3. - [Commits](https://github.com/senny/sablon/compare/v0.3.2...v0.4.3) --- updated-dependencies: - dependency-name: sablon dependency-version: 0.4.3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9dd0ac3dfb..87064bf43f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -572,9 +572,9 @@ GEM logger ruby2_keywords (0.0.5) rubyzip (2.4.1) - sablon (0.3.2) + sablon (0.4.3) nokogiri (>= 1.8.5) - rubyzip (>= 1.1.1) + rubyzip (>= 1.3.0) safe_shell (1.1.0) sanitize (7.0.0) crass (~> 1.0.2) From 1ed84e68fb5ac59da0c65cf41c51c5b2ad0642e3 Mon Sep 17 00:00:00 2001 From: Linda Goldstein Date: Fri, 28 Nov 2025 19:53:19 -0500 Subject: [PATCH 2/3] fix: add template validation for sablon 0.4.3 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sablon 0.4.3 no longer raises Zip::Error for nonexistent template files, instead returning an empty ZIP. This breaks the error handling in CaseCourtReportsController that relies on catching Zip::Error to show users a friendly "Template is not found" message. Changes: - Add file existence validation in CaseCourtReport#initialize - Raise Zip::Error with descriptive message if template doesn't exist - Update test to expect error during initialization (fail-fast approach) - Maintain backward compatibility with existing error handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/models/case_court_report.rb | 2 ++ spec/models/case_court_report_spec.rb | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/case_court_report.rb b/app/models/case_court_report.rb index de42504e11..12e6062523 100644 --- a/app/models/case_court_report.rb +++ b/app/models/case_court_report.rb @@ -7,6 +7,8 @@ class CaseCourtReport def initialize(path_to_template:, context:) @context = context + # Validate template exists before processing (sablon 0.4+ no longer raises Zip::Error) + raise Zip::Error, "Template file not found: #{path_to_template}" unless File.exist?(path_to_template) # NOTE: this is what is used for docx templates @template = Sablon.template(path_to_template) end diff --git a/spec/models/case_court_report_spec.rb b/spec/models/case_court_report_spec.rb index ca6185300c..9ed0245197 100644 --- a/spec/models/case_court_report_spec.rb +++ b/spec/models/case_court_report_spec.rb @@ -393,8 +393,9 @@ path_to_template: nonexistent_path } context = CaseCourtReportContext.new(args).context - bad_report = CaseCourtReport.new(path_to_template: nonexistent_path, context: context) - expect { bad_report.generate_to_string }.to raise_error(Zip::Error) + expect { + CaseCourtReport.new(path_to_template: nonexistent_path, context: context) + }.to raise_error(Zip::Error, /Template file not found/) end end From 687e12308129cb526fd92ef1ca1d6aa37359f1b1 Mon Sep 17 00:00:00 2001 From: Linda Goldstein Date: Fri, 28 Nov 2025 19:53:19 -0500 Subject: [PATCH 3/3] fix: add template validation for sablon 0.4.3 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sablon 0.4.3 no longer raises Zip::Error for nonexistent template files, instead returning an empty ZIP. This breaks the error handling in CaseCourtReportsController that relies on catching Zip::Error to show users a friendly "Template is not found" message. Changes: - Add file existence validation in CaseCourtReport#initialize - Raise Zip::Error with descriptive message if template doesn't exist - Update test to expect error during initialization (fail-fast approach) - Maintain backward compatibility with existing error handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/models/case_court_report.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/case_court_report.rb b/app/models/case_court_report.rb index 12e6062523..92bce740b5 100644 --- a/app/models/case_court_report.rb +++ b/app/models/case_court_report.rb @@ -9,6 +9,7 @@ def initialize(path_to_template:, context:) @context = context # Validate template exists before processing (sablon 0.4+ no longer raises Zip::Error) raise Zip::Error, "Template file not found: #{path_to_template}" unless File.exist?(path_to_template) + # NOTE: this is what is used for docx templates @template = Sablon.template(path_to_template) end