Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to trigger a function to work only when a comment is made?
Thank you mary for pointing me to the PreSaveComment and PostSaveComment delegates in the DiscussionForm control in order to trigger a new function/extension I'm working on to only work when a new comment or discussion item is added. In my testing, I have had success except for one thing. The function is executed but the display of the information is not updated in the side panel unless I select the Discussions tab or Categories or something else. Can you help me determine what I need to call to cause the page to refresh? Do I need to add a reference to CallDelegate('PostSaveComment")?
Thank you.
Thank you.
0
This discussion has been closed.
Comments
$Context->AddToDelegate("DiscussionForm", "PostSaveData", "xxx");
by replacing PostSaveData with different delegates. Maybe I just have chosen the correct delegate.
It would help if you told us a little more about the extension (ie. what are you trying to do?)...
On a lighter note, it's not updating on that page because you add the panel string before your hook is called. I'd recomment using a delegate (for the panel string) that is sure to be called after 'PostSaveData', but will be called whether or not the comment is being saved.