Hyrax v2.1.0
Trying to troubleshoot an error batch uploading into an existing User Collection in v2.1.0. I am getting an error "Cannot create an object of class''".
Batch upload to the site (not issued from within a collection) works fine.
I tried this on the nurax-dev as a sanity check and got the same error.
To reproduce: Collection -> Deposit new work through this collection -> Generic Work -> Create work -> Batch upload ...... Save.
Error: "Cannot create an object of class''"
Still broken on Hyrax Version: 3.0.0.pre.beta1
Hyrax Branch: master
Hyrax Revision: b5c6605917c01c51b4504f7e27999146fc584713
Tried it on nurax-dev just now.
This error occurs if the batch upload link is clicked from the "Add new work" form.
This seems to happen regardless of whether the you go in through the collection. If you go to deposit a work, and click the batch upload button at the top, the work class is lost and the deposit fails.
Since this button doesn't work, I'd propose simply removing it.
cc: @samvera/hyrax-repo-managers
I think removing it is reasonable.
For reference, it's the batch link here in the helper text. The batch upload from dashboard: works: does work.

Last week I came to add an issue for this so I could link this one from our project to it: https://tools.lib.umich.edu/jira/browse/HELIO-2279
Was happy to see it's already here!
TL;DR Getting the batch create form to work when using the offending link is just a matter of adding the missing payload_concern URL parameter to that link. I will add a PR for this, giving the option of retaining the offending link. Up to you guys.
This parameter allows the form and controller to know what type of model is being batch created, depending on what they chose in the initial dialog. The dialog looks like this for a custom work imaginatively named Work (the third one):

BAD link is missing payload_concern param. So regardless of choice it looks like:
http://localhost:3000/batch_uploads/new?locale=en
GOOD, this is what the link should look like for each of the selections shown, in order:
http://localhost:3000/batch_uploads/new?locale=en&payload_concern=GenericWork
http://localhost:3000/batch_uploads/new?locale=en&payload_concern=NamespacedWorks%3A%3ANestedWork
http://localhost:3000/batch_uploads/new?locale=en&payload_concern=Work
Working through the code a little...
missing param sets hidden field on form
https://github.com/samvera/hyrax/blob/5a9d1be16ee1a9150646384471992b03aab527a5/app/controllers/hyrax/batch_uploads_controller.rb#L47
https://github.com/samvera/hyrax/blob/5a9d1be16ee1a9150646384471992b03aab527a5/app/views/hyrax/batch_uploads/_form.html.erb#L14
...which is necessary to determine the type of class that is being batch-created.
And the specific error received comes from the check whether the current user is authorized to this type of class:
https://github.com/samvera/hyrax/blob/5a9d1be16ee1a9150646384471992b03aab527a5/app/controllers/hyrax/batch_uploads_controller.rb#L54
Of course the feature spec clicks the already working link/button but I can see to it that ./spec/views/hyrax/base/_form.html.erb_spec.rb verifies the payload_concern parameter is on this link.
If this is working +1 to keeping the link!