Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Is PostController_BeforeSaveComment_Handler working?
TiGR
✭
I'm trying to write a plugin that interferes in posting and applies some formatting rules to post body. I've written something like this:
But this code just does not work. No matter what I put into these functions (even die()) it's clear, that these just never get called. I've tried using different controllers, but that didn't help also.
public function PostController_BeforeSaveComment_Handler(&$Sender) {
}
public function PostController_BeforeSaveDiscussion_Handler(&$Sender) {
}
But this code just does not work. No matter what I put into these functions (even die()) it's clear, that these just never get called. I've tried using different controllers, but that didn't help also.
Tagged:
0
Comments
Vanilla Forums COO [GitHub, Twitter, About.me]
BTW:
$ grep -E "Save(Discussion|Comment)" applications/ -R applications/vanilla/models/class.commentmodel.php: * Events: BeforeSaveComment, AfterSaveComment. applications/vanilla/models/class.commentmodel.php: $this->FireEvent('BeforeSaveComment'); applications/vanilla/models/class.commentmodel.php: $this->FireEvent('AfterSaveComment'); applications/vanilla/models/class.discussionmodel.php: * Events: BeforeSaveDiscussion, AfterSaveDiscussion. applications/vanilla/models/class.discussionmodel.php: $this->FireEvent('BeforeSaveDiscussion'); applications/vanilla/models/class.discussionmodel.php: $this->FireEvent('AfterSaveDiscussion'); $ grep -E "(Discussion|Comment)Save" applications/ -R applications/vanilla/controllers/class.postcontroller.php: $this->FireEvent('AfterDiscussionSave'); applications/vanilla/controllers/class.postcontroller.php: $this->FireEvent('AfterCommentSave');
Vanilla Forums COO [GitHub, Twitter, About.me]
There is no reason for a single event to "stop working".
Vanilla Forums COO [GitHub, Twitter, About.me]
Proper name is CommentModel_BeforeSaveComment_Handler
Vanilla Forums COO [GitHub, Twitter, About.me]