#29920 (Autosave breaks if post revision fields contains a value that isn't a string) – WordPress Trac (original) (raw)

#29920 new defect (bug)

Reported by: mattheu's profile Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Revisions Keywords: has-patch
Focuses: Cc:

This isn't exactly a bug...

Its possible to filter '_wp_post_revision_fields' to add more fields. I am using this to track revisions for some meta fields.

However the value of this must be an string otherwise you get notices when trying to create an autosave - as this calls normalize_whitespace on an array.

It would be nice if this didn't completely break things. I've added a patch that only calls normalize whitespace if both values are strings - otherwise just do a simple comparison.

If you think i'm doing_it_wrong - feel free to tell me so!

I guess this is related to #20564 and any other meta revision fields.