Plugin hooks to detect configuration changes

Post Reply
joho
Master Bludit
Posts: 63
Joined: Thu Jun 08, 2023 3:02 pm
Location: Sweden
Has thanked: 17 times
Been thanked: 19 times

While diving into the various hooks a Bludit Plugin has access to, I'm stumbling to find a place in the chain of execution that allows me to check if a configuration item has changed. Is there a place that I can hook into that'll let me look at a database value before and after?

The init() hook won't work, because it's called before the plugin's database is initialized.

The afterFormSave() hook doesn't seem to be called at all in a plugin, but maybe I'm doing it wrong. Or maybe it has been removed, I can't find any mention of it anywhere except in the documentation.

The post() hook seems to work, but I don't know if that's intended to be used.

In other words, in your plugin, you'd have this:

Code: Select all

public function post() {
  // do what you need to do here
  // ..
  // call parent method
  parent::post();
}
Post Reply