Project

General

Profile

Defect #44428

Updated by Go MAEDA 1 day ago

After updating the json gem to 3.0.0, JSON API requests with a request body (POST/PUT) fail, and many API tests fail with the following error: 

 <pre> 
 Error: 
 Redmine::ApiTest::IssuesTest#test_GET_/issues/:id.json_with_no_spent_time_should_return_floats: 
 ArgumentError: wrong number of arguments (given 2, expected 1) 
     test/integration/api_test/issues_test.rb:371:in 'block in <class:IssuesTest>' 
 </pre> 

 This is caused by an incompatibility between json 3.0.0 and ActiveSupport in Rails 8.1.3.1. Rails has already fixed it in "rails/rails#58601":https://github.com/rails/rails/pull/58601, "rails/rails#58601:https://github.com/rails/rails/pull/58601, but no Rails release includes the fix yet. 

 Currently, only trunk is affected. In 7.0-stable and 6.1-stable, the older RuboCop versions depend on @json ~> 2.3@, which prevents json 3.0.0 from being installed. Trunk uses RuboCop 1.90.0, which relaxed the requirement to @json >= 2.3@, so @bundle update@ now installs json 3.0.0. 

 Until a Rails version containing the fix is released, json should be pinned to 2.x in the Gemfile: 

 <pre> 
 gem "json", "< 3.0" 
 </pre> 

Back