Log in

View Full Version : Hooks related to private messages not working?


Zahl
02-22-2009, 01:08 PM
Hi there,

is it possible that there is some feature/function or something else that prevents plugins that hook some private message related stuff from being executed? I checked the general settings for hooks, but there I can just enable or disable hooks completely.
Maybe its just me, but I tried to add a hook for private_insertpm_complete and it just did nothing. First I checked my code again and again, added ebug outputs, and in the end, I just typed in some random stuff that is not valid PHP Code, so I expected to get a "parse error in eval()'d code" when I would try to send a private message, but it still worked, no errors.
Then I tried to hook pmdata_postsave, but also no luck.
And yes, I selected "activate this plugin" ;)
Other hooks work just fine, like reputation_add_complete...

Any help would be appreciated.

ragtek
02-22-2009, 01:29 PM
whats happening if you try [php]die('here it should stop'); ???
thats the way, i debug/check my plugins/hook positions

Zahl
02-22-2009, 06:09 PM
Just tried that, and it still executes as if there was no plugin :(

Zahl
02-24-2009, 01:03 PM
Could some other addon or plugin cause this, technically?
There are no plugins that directly hook any private message stuff, but still...

This is really annoying and I have no clue where to start looking for the cause.

Lynne
02-24-2009, 02:26 PM
Are you sure you are doing an action that actually uses the plugin where you have it hooked?

Zahl
02-24-2009, 03:43 PM
Well... private_insertpm_complete should definetely be triggered when you send a pm, no?
At least as far as I understand by reading the source of private.php

Lynne
02-24-2009, 04:24 PM
That hook should get processed if everything is fine in the PM. Is the PM being sent?

Zahl
02-24-2009, 04:49 PM
Yep, I already annoyed several people in my forum with test messages. ;)
I still have die("test"); as plugin code, but it just takes me to my inbox again after sending.
Also tried to hook private_insertpm_process, which should be triggered both, when actually sending the pm and when just displaying a preview... But no luck.

Its either me being very stupid or something is really broken... (Running 3.6.7 btw)

EDIT: Hooking private_start works...

ragtek
02-24-2009, 05:02 PM
Strange, if i create a plugin at insertpm_complete with die('here'); it stops here

have you maybe some other plugins at this hook which redirect on some other side?

Zahl
02-24-2009, 05:32 PM
No, there are no private_* related plugins, that's what confuses me too.
I'm gonna disable all addons except mine now, let's see if that helps.

Lynne
02-24-2009, 05:35 PM
It could be a plugin that gets called in another file that is included in the script. So yeah, your approach to turn them all off to find the problem is a good one.

Zahl
02-24-2009, 06:28 PM
No success :(

Well I'm gonna mess around with private.php tomorrow, adding some debug output etc..

ragtek
02-24-2009, 06:33 PM
Have you the original or a modified file?*g*

Dismounted
02-25-2009, 07:52 AM
Reupload private.php, as well as hooks-vbulletin.xml in the includes/xml directory.

Zahl
07-04-2009, 01:25 PM
Sorry for this really late reply.
Nothing suggested here worked back then, and because my exam period started, I stopped investigating on this issue.


For the record: Updated to 3.8.2 a few days ago, and the plugins (which I left active) started working immediately :)