blacklight icon indicating copy to clipboard operation
blacklight copied to clipboard

document_has_value? should return false if the value is blank

Open mattcg opened this issue 8 years ago • 3 comments

Currently, if the document has a key but the value is blank (an empty string, for example) or an empty array on a multivalued field, document_has_value? will still return true. This results in a kind of ugly mess of empty fields:

image

mattcg avatar Feb 27 '17 12:02 mattcg

Hm. That seems weird. Are you using highlight fields or model accessors, by any chance?

cbeer avatar Mar 07 '17 15:03 cbeer

Highlight fields.

Another problem that perhaps needs to be kept in mind is that if you're using hl.defaultSummary and the field starts with a lot of white space, all the whitespace characters will be encoded to HTML entity equivalents by the pipeline, so a call to strip.blank? will still yield false in helpers.

mattcg avatar Mar 07 '17 15:03 mattcg

cf #1388

barmintor avatar Oct 24 '18 17:10 barmintor