XF 2.2 How to catch the event of "Style property changed"?

mazzly

Well-known member
Hi,

I've got a problem I've been bashing my head with now for a while.

When a StyleProperty related to my addon is changed, I want to trigger an event.

I thought this would be possible with:

PHP:
public static function entity_post_save(Entity $entity)
{
    if ($entity instanceof StyleProperty && $entity->addon_id == 'Me/Addon') {
        triggerEvent();
    }
}

In the dev env, the event in triggered when a value is saved.
When I install it to my live site, the event doesn't trigger..

Something makes me think it might be that StyleProperty is not the correct entity to listen to?

Anyone got ideas?

Cheers!
 
To clarify: When the value in a Style property changes, how can I catch that something changed?
 
The addon_id column will only be set for style properties in the master style. When a style property is edited from the master value, a new record is created. You would probably want to look at the property_name instead.
 
Back
Top Bottom