diff --git a/app/assets/javascripts/my_modules/protocols.js.erb b/app/assets/javascripts/my_modules/protocols.js.erb index 870b1bba3..4dd5ea523 100644 --- a/app/assets/javascripts/my_modules/protocols.js.erb +++ b/app/assets/javascripts/my_modules/protocols.js.erb @@ -133,6 +133,7 @@ function initCopyToRepository() { }) .on("ajax:error", function(e2, data2) { // Display errors in form + submitBtn[0].disabled = false; if (data2.status === 422) { $(this).renderFormErrors("protocol", data2.responseJSON); } else { diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index b2dd83274..d392a3de8 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -464,7 +464,7 @@ class ProtocolsController < ApplicationController # Everything good, display flash & render 200 log_activity(:update_protocol_in_task_from_repository, @protocol.my_module.experiment.project, - my_module: @my_module.id, + my_module: @protocol.my_module.id, protocol_repository: @protocol.parent.id) flash[:success] = t( 'my_modules.protocols.update_from_parent_flash' diff --git a/app/models/protocol.rb b/app/models/protocol.rb index 0cd98b856..e113d90b5 100644 --- a/app/models/protocol.rb +++ b/app/models/protocol.rb @@ -704,7 +704,7 @@ class Protocol < ApplicationRecord def destroy_contents(current_user) # Calculate total space taken by the protocol st = self.space_taken - steps.pluck(:id) do |id| + steps.pluck(:id).each do |id| unless Step.find(id).destroy(current_user) raise ActiveRecord::RecordNotDestroyed end