Skip to content

Commit

Permalink
Merge pull request #5283 from samvera/val_col_create_forward
Browse files Browse the repository at this point in the history
fix failure to forward to collection edit after create for PcdmCollection
  • Loading branch information
dlpierce authored Dec 10, 2021
2 parents fdf78a1 + c8a2997 commit 85c8c7c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/controllers/hyrax/dashboard/collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ def edit
end

def after_create
form
set_default_permissions
# if we are creating the new collection as a subcollection (via the nested collections controller),
# we pass the parent_id through a hidden field in the form and link the two after the create.
link_parent_collection(params[:parent_id]) unless params[:parent_id].nil?
if @collection.is_a?(ActiveFedora::Base)
form
set_default_permissions
# if we are creating the new collection as a subcollection (via the nested collections controller),
# we pass the parent_id through a hidden field in the form and link the two after the create.
link_parent_collection(params[:parent_id]) unless params[:parent_id].nil?
end
respond_to do |format|
Hyrax::SolrService.commit
format.html { redirect_to edit_dashboard_collection_path(@collection), notice: t('hyrax.dashboard.my.action.collection_create_success') }
Expand Down Expand Up @@ -226,6 +228,7 @@ def valkyrie_create
.call(form)
.value_or { return after_create_error }

after_create
add_members_to_collection unless batch.empty?
@collection
end
Expand Down

0 comments on commit 85c8c7c

Please sign in to comment.