You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hyrax version 2.9.6 working with Hyku; however in looking at later (and early) versions this may be a problem that is not limited to version 2.9.6.
When submitting a new work that is invalid (e.g. fails server-side field validation), when we re-render the create HTML form we have new input fields on the page. Then when we go to re-submit the page, those new fields are creating a condition in which we raise an exception in Hydra::AccessControls.
Conjecture
During the initial page submission the actor stack is adding "default/additional non-submitted" permissions_attributes to the curation_concern before the validation.
The validation then fails and those permission attributes remain on the curation_concern object.
Because the validation fails, we now render the new HTML page and the HTML form includes a new set of input elements. When we now submit the page, with these newly added input elements, we encounter a HydraAccess Controls exception because these new input elements are invalid.
Breadcrumbs
The HTML form renders the partial: app/views/hyrax/base/_form_share.html.erb. On the initial render, the f.fields_for :permissions is empty. On the second render (e.g. after the validation failed), the f.field_for :permissions is populated.
By the time we get to the ImageActor, we already have what we believe to be an incorrect permissions data structure. Our current conjecture is that this is one of the following:
Hyrax::Actors::CollectionsMembershipActor
Hyrax::Actors::InterpretVisibilityActor
Hyrax::Actors::ApplyPermissionTemplateActor
It appears, after debugging, that this was the ApplyPermissionTemplateActor. The fundamental issue is that the rendered form is not passing in the correct "type" to the template actor.
Work Around
In the app/views/hyrax/base/_form_share.html.erb we added a guard clause to say "don't render these permissions when we have a new record".
Hyrax version 2.9.6 working with Hyku; however in looking at later (and early) versions this may be a problem that is not limited to version 2.9.6.
When submitting a new work that is invalid (e.g. fails server-side field validation), when we re-render the create HTML form we have new input fields on the page. Then when we go to re-submit the page, those new fields are creating a condition in which we raise an exception in Hydra::AccessControls.
Conjecture
permissions_attributes
to thecuration_concern
before the validation.curation_concern
object.new
HTML page and the HTML form includes a new set ofinput
elements. When we now submit the page, with these newly addedinput
elements, we encounter a HydraAccess Controls exception because these new input elements are invalid.Breadcrumbs
The HTML form renders the partial: app/views/hyrax/base/_form_share.html.erb. On the initial render, the
f.fields_for :permissions
is empty. On the second render (e.g. after the validation failed), thef.field_for :permissions
is populated.By the time we get to the ImageActor, we already have what we believe to be an incorrect
permissions
data structure. Our current conjecture is that this is one of the following:Hyrax::Actors::CollectionsMembershipActor
Hyrax::Actors::InterpretVisibilityActor
Hyrax::Actors::ApplyPermissionTemplateActor
It appears, after debugging, that this was the ApplyPermissionTemplateActor. The fundamental issue is that the rendered form is not passing in the correct "type" to the template actor.
Work Around
In the
app/views/hyrax/base/_form_share.html.erb
we added a guard clause to say "don't render these permissions when we have a new record".It's also confusing why the
fields_for :permissions
does not render the hiddentype
for the permission, because the lack of thattype
is raising the exception in https://github.com/samvera/hydra-head/blob/6fc0e369a3f652cf06656a20354c4c4b972f9b09/hydra-access-controls/app/models/hydra/access_controls/permission.rb#L70-L80`
The text was updated successfully, but these errors were encountered: