Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orphan Hydra::AccessControl object created when rendering the 'new' work form #1102

Open
ghost opened this issue Nov 19, 2016 · 0 comments
Open

Comments

@ghost
Copy link

ghost commented Nov 19, 2016

Descriptive summary

On calling up a new work form, a Hydra::AccessControl object is created in Fedora. This object is never used. On saving the new work, a new Hydra::AccessControl containing the Permissions objects gets created.

The object is created during rendering of base/_form_permission.html.erb

From the console:

Rendered /curation_concerns-1.6.2/app/views/curation_concerns/base/_form_media.html.erb (0.4ms)
Attempted to init base path dev, but it already exists
Load LDP (9.9ms) http://localhost:8984/rest/dev/dc/a9/fa/af/dca9faaf-0dc9-4d8d-b42a-0e1d06363498 Service: 69901153988960 [NEW OBJECT IS NOW IN FEDORA / SOLR]
Rendered curation_concerns/base/_form_permission.html.erb

Removing bits of the code to pinpoint where this happens, it is caused by the radio buttons rendering in _form_permission.html.erb. The object gets created even with just the following.

      <%= f.radio_button :visibility, 'something' %>

Observed in 1.6.2 and 1.6.3

The same behavior is happens for Collection.

Expected behavior

Either the Hydra::AccessControl should be used to contain the subsequent permissions objects, or this object should not be created at all.

Actual behavior

An orphan Hydra::AccessControl is created.

Steps to reproduce the behavior

  1. Bring up a vanilla curation concerns app
  2. Run the generator to create a work
  3. Hit 'new work'
  4. Observe the console output

For additional debug output, copy _form_permission.html.erb locally and add

<%= debug @curation_concern %>

Related work

See similar issue in this Hydra Tech thread:
https://groups.google.com/forum/#!topic/hydra-tech/dFRpIO8h2AQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants