When entity goes to validate / sanitize a body / longtext field it calls this function for output. The problem arrises when there is no text set in the text field / the field isn't set at all on the entity. This causes the field to throw property / array value not set notices all over the place. This becomes especially apparent when utilizing a project like restws which can make calls like /node.json to return all nodes in a site in json format. This call causes empty fields to be transmitted as output (and their output sanitized) where as a normal loading of the node via http call won't try and sanitize empty data.
Patch in bound, very simple to test for and resolve.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2264765-5.patch | 1.87 KB | BR0kEN |
| |||
#1 | entity-metadata-text-notices-empty-2264765-1.patch | 1020 bytes | btopro |
Comments
Comment #1
btopro CreditAttribution: btopro commentedPatch
Comment #2
btopro CreditAttribution: btopro commentedstill applies cleanly w/ latest
Comment #3
MustangGB CreditAttribution: MustangGB commentedComment #4
fagoThat seems to be reasonable, but I think this needs some test coverage and ideally some more testers (who actually report they tested it) also.
Comment #5
BR0kENPersonally I came from the #2429129: Call entity with no "body". I think we shouldn't assume that
body
field exists for every content type.Comment #6
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe patch in #5 to node.info.inc applied cleanly to the latest entity 7.x-1.x-dev, but still needs to be reviewed and tested.