Fixed Webhook criteria are not easily composable

Xon

Well-known member
Affected version
2.3.6
When implementing additional criteria, XF exposes the method XF\Webhook\Event\AbstractHandler::getCriteriaClass.

The problem is if XF doesn't implement one, it returns null. So if a 3rd party add-on implements it, it will override any other 3rd party criteria class and any future XF criteria.

IE implementing XF\Webhook\Event\PostHandler::getCriteriaClass will override any future post criteria.

I think the better solution would be for XF to implement a base criteria class for all webhook events to allow extending. Maybe some simple codegen like finders but for webhook criteria
 
Last edited:
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.3.8).

Change log:
Add base webhook criteria classes
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom