Reply to thread

With the efforts to transition from serialized to json for storing arrays in XenForo 2.1, it occurred to me that this might not be entirely possible for Custom Fields, since this would mean all 3rd party add-ons would see their custom fields in a non-workable state until such a time as the author could release an update.


It would be possible to stagger the switch by adding a new option to XF\Behavior\CustomFieldsHolder :: getDefaultConfig:

[code=php]'storage' => 'serialized'[/code]

It would then be possible to change the relevant line to

[code=php]'field_value' => is_array($value) ? ($this->config['storage'] == 'serialized' ? serialize($value) : json_encode($value)) : $value[/code]

Defaulting to "serialized" would allow developers to update their addons at their own pace without breaking backwards compatibility.


Back
Top Bottom