XF 2.1 Edit History with multiple values

Zig

Member
Hello everyone,

I'm currently working on an add-on that will require storing multiple values in its Edit History. My initial thought was to set up a near-clone of the core Edit History entity where the string typed old_text column is replaced with a json_array typed old_content column. However, it occurred to me that since json_encode() returns a string, I could simply handle the JSON encoding myself and store the resulting string in the existing XF:EditHistory table.

I'm aware that I'd be storing the resulting JSON in a mediumtext column instead of the mediumblob column I set up for the custom Edit History table, which carries with it the implications of character set conversion, but I don't anticipate that causing issues.

Am I missing anything? Is there are a good reason to not store the string returned by json_encode() in the old_text column of EditHistory?

Thanks,
zig
 
Back
Top Bottom