X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/96fe9fc822c2270cb6e4212798d61e61481ec2e0..360b5d19eb0cb595fd34d11aa6426d95b3c974d4:/apps/workbench/app/controllers/application_controller.rb diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 7d7ea9534b..f739ee1046 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -132,12 +132,15 @@ class ApplicationController < ActionController::Base end helper_method :next_page_offset - def next_page_offset - if @objects.respond_to?(:result_offset) and - @objects.respond_to?(:result_limit) and - @objects.respond_to?(:items_available) - next_offset = @objects.result_offset + @objects.result_limit - if next_offset < @objects.items_available + def next_page_offset objects=nil + if !objects + objects = @objects + end + if objects.respond_to?(:result_offset) and + objects.respond_to?(:result_limit) and + objects.respond_to?(:items_available) + next_offset = objects.result_offset + objects.result_limit + if next_offset < objects.items_available next_offset else nil @@ -258,7 +261,7 @@ class ApplicationController < ActionController::Base if @object.name and @object.name != '' @object.name = "Copy of #{@object.name}" else - @object.name = "Copy of unnamed #{@object.class_for_display.downcase}" + @object.name = "" end end @object.save!