samvera-deprecated / sufia

[DEPRECATED] Sufia: a fully featured, flexible Samvera repository front-end.
http://sufia.io/
Other
111 stars 78 forks source link

Creating an admin set is broken in 7.3.0 #3161

Closed hortongn closed 7 years ago

hortongn commented 7 years ago

Descriptive summary

When an admin user fills out the form to create a new admin set and tries to save, the following error occurs:

ArgumentError in Sufia::Admin::AdminSetsController#create wrong number of arguments (given 2, expected 3)

The problem is the initializer in AdminSetCreateService is defined with def initialize(admin_set, creating_user, workflow_name) while the create_admin_set method in AdminSetsController is passing AdminSetCreateService.new(@admin_set, current_user).create with no workflow name.

See https://github.com/projecthydra/sufia/blob/v7.3.0/app/controllers/sufia/admin/admin_sets_controller.rb#L98 and https://github.com/projecthydra/sufia/blob/v7.3.0/app/services/sufia/admin_set_create_service.rb#L19

Passing the contents of params[:admin_set][:workflow_name] as a third param does fix it.

Steps to reproduce the behavior

  1. Generate a test app, an admin user, and create a default admin set
  2. Go to /admin/admin_sets/new, fill out the form, and try to save

Looks like the bug was introduced in https://github.com/projecthydra/sufia/commit/d49df2fd4577c674928069696d758b68b393d72a

mjgiarlo commented 7 years ago

Good catch, @hortongn