Custom fields are currently not saved in edit history. At times, custom fields can be just as important as the message, if not add greater value to the message as well. Not preserving this in an edit is tantamount to loss of data with a bad edit.
Table xf_edit_history
only shows column old_text
, preserving the message only.
A few ways this could be done:
- The more logical way, add a JSON BLOB of the "old_custom_thread_fields" to
xf_edit_history
to save the custom fields (if or if not changed, could be ""/NULL to save space if no change was made and the value if a change was made). - Update column
field_value
in xf_thread_field_value
with JSON containing xf_edit_history
's edit_date
with the corresponding changed value to link the two.
If the custom fields don't exist after an edit (removed), they simply would be ignored and not restored if the post is taken back in time. However, if they do exist, the custom fields should revert back to the previous value, if changed.
This should also be standard for XFMG and XFRM for any custom field for any content that allows for custom fields, obviously with the tables/columns to correspond.