Juergen Posted June 8, 2023 Share Posted June 8, 2023 Today I have discovered a strange behavior: On the latest dev version of ProcessWire my Modules::saveConfig Hooks does not fire anymore. This hook should fire after a module configuration has been saved. I got no entry inside the error logs and testing it with Tracy does not give me any information. The hook runs inside the init function inside a module: public function init():void { $this->wire->addHookAfter('Modules::saveConfig', function(HookEvent $event) { $event->message("You saved the module config"); }); } The method above is only for testing purposes, but it outputs nothing if I hit the save button of the module configuration (BTW: I have tested it with addHookBefore and addHookAfter and also with Tracy bd() calls). I am not sure that this issue is since the ProcessWire 3.0.219 but I have discovered the issue there and this hook has worked in the past. Does someone discover the same issue or has an idea, what a possible reason could be? Thanks in advance Link to comment Share on other sites More sharing options...
matjazp Posted June 8, 2023 Share Posted June 8, 2023 Does hook fire on Modules::saveModuleConfigData? 2 Link to comment Share on other sites More sharing options...
Juergen Posted June 8, 2023 Author Share Posted June 8, 2023 Yes, it does!!! But I swear, it has worked in the past with saveConfig!! Anyway, problem solved!! Thank you so much!! Link to comment Share on other sites More sharing options...
matjazp Posted June 8, 2023 Share Posted June 8, 2023 I'm not sure this is ok, as saveModuleConfigData is: "@deprecated Please use saveConfig() method instead". saveConfig() is hookable and it should fire, so not sure what's going on. Maybe others have an idea? Link to comment Share on other sites More sharing options...
Juergen Posted June 8, 2023 Author Share Posted June 8, 2023 Ok, this is strange, because the deprecated version works and the current not ?. Thanks for the additional info - I will leave this thread open. Link to comment Share on other sites More sharing options...
ryan Posted June 8, 2023 Share Posted June 8, 2023 @Juergen I'm updating this in wire/core/Modules.php: public function ___saveModuleConfigData($className, array $configData) { return $this->configs->saveConfig($className, $configData); } to this: public function ___saveModuleConfigData($className, array $configData) { return $this->saveConfig($className, $configData); } I think that'll fix it, though let me know if you find it still doesn't work. Thanks. 2 Link to comment Share on other sites More sharing options...
Juergen Posted June 8, 2023 Author Share Posted June 8, 2023 Hello @ryan Your update works ?! Thanks!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now