nurkka Posted October 27, 2021 Share Posted October 27, 2021 Hi everybody, while testing $config->debugIf, I noticed, that it wouldn't work with custom functions. Example /site/config.php: function custom_debug_if () { return true; // simply for test reasons } $config->debugIf = 'custom_debug_if'; This doesn't work because the if(is_callable($debugIf)) in ProcessWire.php returns false. The debugIf-documentation says: * 2) Your own callable function name (i.e. "debug_mode") in /site/config.php that returns * true or false for debug mode; How is it possible to use this feature? Thanks and best regards! Link to comment Share on other sites More sharing options...
BitPoet Posted October 27, 2021 Share Posted October 27, 2021 is_callable doesn't resolve namespaces. It should work if you use "ProcessWire\\custom_debug_if". I'm not sure why ProcessWire.php doesn't use wireIsCallable() at that spot. Might be worth raising an issue. 2 1 Link to comment Share on other sites More sharing options...
nurkka Posted October 28, 2021 Author Share Posted October 28, 2021 Thanks BitPoet, the following code worked: function custom_debug_if () { return true; // simply for test reasons } $config->debugIf = 'ProcessWire\\custom_debug_if'; Using if(wireIsCallable($debugIf)) instead of if(is_callable($debugIf)) in ProcessWire.php made no difference. Thanks again and best regards! 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