diff --git a/app/transactions/hyrax/transactions/iiif_print_container_decorator.rb b/app/transactions/hyrax/transactions/iiif_print_container_decorator.rb index 18a9999a..c7492606 100644 --- a/app/transactions/hyrax/transactions/iiif_print_container_decorator.rb +++ b/app/transactions/hyrax/transactions/iiif_print_container_decorator.rb @@ -28,27 +28,29 @@ class IiifPrintContainerDecorator end end - namespace 'change_set' do |ops| - ops.register 'update_work' do - steps = Hyrax::Transactions::WorkUpdate::DEFAULT_STEPS.dup - steps.insert(steps.index('work_resource.update_work_members') + 1, 'work_resource.set_child_flag') - Hyrax::Transactions::WorkUpdate.new(steps: steps) - end - end - - if defined?(Bulkrax::Container) - namespace 'work_resource' do |ops| - ops.register Bulkrax::Container::UPDATE_WITH_BULK_BEHAVIOR do - steps = Bulkrax::Container::UPDATE_WITH_BULK_BEHAVIOR_STEPS.dup + if ENV['HYKU_IIIF_PRINT'] + namespace 'change_set' do |ops| + ops.register 'update_work' do + steps = Hyrax::Transactions::WorkUpdate::DEFAULT_STEPS.dup steps.insert(steps.index('work_resource.update_work_members') + 1, 'work_resource.set_child_flag') Hyrax::Transactions::WorkUpdate.new(steps: steps) end end - end - namespace 'work_resource' do |ops| - ops.register 'set_child_flag' do - Steps::SetChildFlag.new + if defined?(Bulkrax::Transactions::Container) + namespace 'work_resource' do |ops| + ops.register Bulkrax::Transactions::Container::UPDATE_WITH_BULK_BEHAVIOR do + steps = Bulkrax::Transactions::Container::UPDATE_WITH_BULK_BEHAVIOR_STEPS.dup + steps.insert(steps.index('work_resource.update_work_members') + 1, 'work_resource.set_child_flag') + Hyrax::Transactions::WorkUpdate.new(steps: steps) + end + end + end + + namespace 'work_resource' do |ops| + ops.register 'set_child_flag' do + Steps::SetChildFlag.new + end end end end