research-technologies / leaf_addons

Additional functionality for Hyrax or Hyku repositories (importers, tasks etc.)
Apache License 2.0
5 stars 0 forks source link

Empty values being added to Fcrepo #8

Closed ghost closed 7 years ago

ghost commented 7 years ago

Single-value elements are adding 'empty' values to Fcrepo, and then showing up in the display interface.

Two solutions:

  1. Fix it, eg. add something to the actor to delete any attributes that equal "" (or " ") before save.
  2. Use multi-valued for everything
ghost commented 7 years ago

Added support in the Actor for this, added a local SharedActor class, inherited by both new Actors that extends Hyrax::BaseActor

Empty fields still show up in the view page so also added a SingleAttributeRenderer class, used with , render_as: :single in _attribute_rows.html.erb