Fixed XF\CustomField\Set is not extendable via class extensions

Xon

Well-known member
Affected version
2.1.9
Is it intended that it is a hard-coded reference to XF\CustomField\Set instead of going via $this->app()->extendClass ?
 
Making a class extendable is usually our default, rather than not. So, yes, very likely intentional.

We can consider changing it, but you'd need to specify your use case for consideration.
 
I've got an add-on which extends several custom fields types and needs to inject a custom set of filters into a DefinitionSet when that set of custom fields is setup for usage. Additionally; the Set object's construction is the closest point for me to reliably detect when XF has rebuild the custom field for a content type's cached definition without my extended fields.

I've also got some custom tweaking of error messages when custom fields are set (mostly around non-provided fields).
 
I second the ability to add custom filters to Set and ability to detect when custom field caches have been rebuilt without our custom field types, these would be useful for one of my add-ons as well.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.10).

Change log:
Implement the ability to extend all XF\CustomField\* classes - specifically Set and DefinitionSet.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom