PDA

View Full Version : report_send_complete hook isn't working


NovoCiv
12-15-2014, 09:13 PM
Nothing happens when I make a plugin for that hook. I looked into plugins from addons that I've installed and they're not firing on the hook either.

For example, with Digital Point Spy there should be an entry in the log for post reports, but every time I make a report there's no new entry in the log.

Looking at my class_reportitem.php I do see the hook code in the correct place:
($hook = vBulletinHook::fetch_hook('report_send_complete')) ? eval($hook) : false;

However, when I make a plugin with the report_send_complete hook it doesn't seem to do anything. My plugin is very simple, for testing purposes:
standard_error(fetch_error('noguests_error', $vbulletin->userinfo['username']));

This should generate an error when I try to report a post. But reporting posts works as normal, and no error can be found.

I've been trying to simplify everything to identify the source of the problem, but I can't figure it out. Any suggestions?

kh99
12-15-2014, 09:18 PM
It looks like that hook is only called if you have Settings > Options > User Infractions & Post Reporting Options > Post Reporting Email set to something other than "No Email". I have no idea what the thinking was there. I guess "send_complete" means the email has been sent.

ozzy47
12-15-2014, 09:20 PM
Try the hook, report_do_report, that should work.

NovoCiv
12-15-2014, 09:56 PM
It looks like that hook is only called if you have Settings > Options > User Infractions & Post Reporting Options > Post Reporting Email set to something other than "No Email". I have no idea what the thinking was there. I guess "send_complete" means the email has been sent.

You know, this explains a lot.

Try the hook, report_do_report, that should work.

There is no such hook. The hooks that I have are:
report_form_start
report_send_complete
report_send_email
report_send_process
report_start



However, given kh99's comments I tried moving the hook line within class_reportitem.php outside of the if ($reportemail) {}

Now the plugins work! Thank you for the quick help. :)

ozzy47
12-15-2014, 10:02 PM
Glad you got it working. Not sure why you don't have that hook. What version are you running?

NovoCiv
12-15-2014, 10:12 PM
I'm back on 4.0.5.

I do extensive modification to the base code and a lot of the mods I use are not updated for newer revisions. It seems easier to just apply security patches than to try to find all of my changes and upgrade the version to current.

ozzy47
12-15-2014, 11:17 PM
Yeah that would explain why you don't have that hook then. :)