From be80a08c6a2a330e81d43fbfd345f05199e75947 Mon Sep 17 00:00:00 2001 From: Ken D'Ambrosio Date: Fri, 12 Jun 2026 14:16:12 +0000 Subject: Fix bulk action 400: Rack maps entries[] to params['entries'] not params['entries[]'] Rack::Utils.parse_nested_query maps form fields named 'entries[]' to params['entries'] (without brackets). The route was reading params['entries[]'] which was always nil, making entries always empty and triggering the halt 400 guard. Co-Authored-By: Claude Sonnet 4.6 --- app.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app.rb') diff --git a/app.rb b/app.rb index 9f02422..36d98ac 100644 --- a/app.rb +++ b/app.rb @@ -1011,7 +1011,7 @@ post '/admin/people/:uuid/bulk_move' do require_admin! src = params[:uuid] action = params['bulk_action'].to_s.strip - entries = Array(params['entries[]']).map { |e| JSON.parse(e) rescue nil }.compact + entries = Array(params['entries']).map { |e| JSON.parse(e) rescue nil }.compact halt 400 if entries.empty? @@ -1117,7 +1117,7 @@ end post '/admin/people/:slug/bulk_reassign' do require_admin! - rels = Array(params['rels[]']) + rels = Array(params['rels']) to_uuid = params['to_uuid'].to_s.strip halt 400 if rels.empty? || to_uuid.empty? @@ -1140,7 +1140,7 @@ end post '/admin/photos/move_album' do require_admin! - rels = Array(params['rels[]']) + rels = Array(params['rels']) dst_rel = params['dst_rel'].to_s.strip.gsub(/\/+$/, '') halt 400 if rels.empty? || dst_rel =~ /\.\./ -- cgit v1.2.3