{"action":"created","issue":{"url":"https://api.github.com/repos/projecthydra-labs/sufia-core/issues/337","labels_url":"https://api.github.com/repos/projecthydra-labs/sufia-core/issues/337/labels{/name}","comments_url":"https://api.github.com/repos/projecthydra-labs/sufia-core/issues/337/comments","events_url":"https://api.github.com/repos/projecthydra-labs/sufia-core/issues/337/events","html_url":"https://github.com/projecthydra-labs/sufia-core/issues/337","id":119575117,"number":337,"title":"Visibility parameter empty error with create new work","user":{"login":"grosscol","id":1520508,"avatar_url":"https://avatars.githubusercontent.com/u/1520508?v=3","gravatar_id":"","url":"https://api.github.com/users/grosscol","html_url":"https://github.com/grosscol","followers_url":"https://api.github.com/users/grosscol/followers","following_url":"https://api.github.com/users/grosscol/following{/other_user}","gists_url":"https://api.github.com/users/grosscol/gists{/gist_id}","starred_url":"https://api.github.com/users/grosscol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosscol/subscriptions","organizations_url":"https://api.github.com/users/grosscol/orgs","repos_url":"https://api.github.com/users/grosscol/repos","events_url":"https://api.github.com/users/grosscol/events{/privacy}","received_events_url":"https://api.github.com/users/grosscol/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/projecthydra-labs/sufia-core/labels/autumn-2015","name":"autumn-2015","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"grosscol","id":1520508,"avatar_url":"https://avatars.githubusercontent.com/u/1520508?v=3","gravatar_id":"","url":"https://api.github.com/users/grosscol","html_url":"https://github.com/grosscol","followers_url":"https://api.github.com/users/grosscol/followers","following_url":"https://api.github.com/users/grosscol/following{/other_user}","gists_url":"https://api.github.com/users/grosscol/gists{/gist_id}","starred_url":"https://api.github.com/users/grosscol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosscol/subscriptions","organizations_url":"https://api.github.com/users/grosscol/orgs","repos_url":"https://api.github.com/users/grosscol/repos","events_url":"https://api.github.com/users/grosscol/events{/privacy}","received_events_url":"https://api.github.com/users/grosscol/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-11-30T20:32:32Z","updated_at":"2015-11-30T21:34:17Z","closed_at":null,"body":"When creating a new work, there is currently a field for visibility *and* a radio button under Permissions that sets visibility.  The result is that the form has two visibility parameters when it is submitted.  The first one is the result of the field and the second is the the radio button.  So when nothing is filled in the field, the controller sees `:visibility => \"\"` regardless of what radio button selection there was.\r\n\r\nRemoving the visibility field `input#generic_work_visibility` should resolve the problem."},"comment":{"url":"https://api.github.com/repos/projecthydra-labs/sufia-core/issues/comments/160768543","html_url":"https://github.com/projecthydra-labs/sufia-core/issues/337#issuecomment-160768543","issue_url":"https://api.github.com/repos/projecthydra-labs/sufia-core/issues/337","id":160768543,"user":{"login":"grosscol","id":1520508,"avatar_url":"https://avatars.githubusercontent.com/u/1520508?v=3","gravatar_id":"","url":"https://api.github.com/users/grosscol","html_url":"https://github.com/grosscol","followers_url":"https://api.github.com/users/grosscol/followers","following_url":"https://api.github.com/users/grosscol/following{/other_user}","gists_url":"https://api.github.com/users/grosscol/gists{/gist_id}","starred_url":"https://api.github.com/users/grosscol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosscol/subscriptions","organizations_url":"https://api.github.com/users/grosscol/orgs","repos_url":"https://api.github.com/users/grosscol/repos","events_url":"https://api.github.com/users/grosscol/events{/privacy}","received_events_url":"https://api.github.com/users/grosscol/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T21:34:17Z","updated_at":"2015-11-30T21:34:17Z","body":"The code that is causing the unwanted visibility field is in `app/views/curation_concerns/base/_form.html.erb` :\r\n```erb\r\n     <div class=\"well\">\r\n      <% f.object.terms.each do |term| %>\r\n        <%= render_edit_field_partial(term, f: f) %>\r\n      <% end %>\r\n    </div>\r\n```\r\n\r\nSo either visibility should not be a term on the object (generic_work) or we should exempt it from being rendered as and edit field."}}