SMF icon indicating copy to clipboard operation
SMF copied to clipboard

Integration Hooks Setting

Open Oldiesmann opened this issue 14 years ago • 4 comments

Just synced up my "smfgit" copy on my server with the repo here, and see that there's now a setting to enable/disable integration hooks. While I definitely agree we should have a setting to disable hooks in an emergency and I like the page listing all the hooks, I don't think having them disabled by default is a good idea, nor do I think we need to have a huge warning telling people to only enable them if they know what they're doing.

As I recall, SMF's current implementation of integration hooks prevents them from breaking things too much anyway - if a function is assigned to a hook, it's only called if it exists. The few non-function hooks (integrate_pre_include for instance) could still break things, but I haven't actually heard of this happening.

Oldiesmann avatar Aug 07 '12 22:08 Oldiesmann

If we had a pure hooks system in place I'd agree with you. But SMF is still a mixed model with hooks and file edits and that can break your site without much hassles by disabling a hook.

If someone (like me from time to time) uses a hook to include the file with the function, and then uses a code edit to call the function when it is needed, disabling the include hook would break the site (or at least the page where the function is called), yes I think I placed some safety measure to avoid this, but the safest measure is to not let people harm with things they don't know (and that said I'm wondering why I'm allowed to code! :P).

Additionally disable a hook is something that nobody should do. Why would you disable a hook? I wouldn't even do it for development (if I want to disable a hook for development I just return the function, it's faster). Have the option there is nice, but IMHO it should be disabled by default. Why reports are disabled by default? They are not dangerous, the worst that can happen is a spike in resources usage, but still are disabled. Why 75% of core features are disabled by default? Because are things that the majority of people will not use on their forums. And that's why I think that disable hooks should be off by default: it's potentially dangerous and it's not necessary to the majority.

emanuele45 avatar Aug 08 '12 09:08 emanuele45

I must have misread/misunderstood the setting yesterday. I thought you had to enable that setting for integration hooks to even work at all, and that's what I was complaining about. As long as integration hooks will still work out-of-the-box without the user having to do anything, I'm fine with the way things are now. We might just need to make it a bit more clear as to what that setting actually does.

Oldiesmann avatar Aug 08 '12 16:08 Oldiesmann

Ohh okay! :D I'm not good with this kind of explanations, feel free to reword it! ;) There is also the backup text that would need a bit of attention... O:)

emanuele45 avatar Aug 09 '12 21:08 emanuele45

So 'Disable hooks' is disabled.

Double negatives are never very understandable. :)

norv avatar Oct 21 '12 14:10 norv