FireEvent isn't working when viewtype is JSON

edited June 2011 in Vanilla 2.0 - 2.8
Hello,
I've created my first example plugin and i have problem with events. I've implemented following method in Example plugin:
public function DiscussionController_BeforeCommentMeta_Handler(&$Sender)
{
echo "HelloExample!";
}

When comment is rendered in normal "fullpage" mode everything works ok (string is displayed). But when user edits a comment (fully in ajax mode), js calls url /vanilla/post/editcomment/5499274/32302 with DeliveryMethod='JSON'.
It returns proper html structure but it looks like it doesn't execute my eventhandler. It's normal behaviour? Is there any way to fix it?
Thanks in advance
Tagged:

Comments

  • ToddTodd Vanilla Staff
    edited June 2011
    Hmm. Can you post an issue on the issue tracker?

    https://github.com/vanillaforums/Garden/issues
  • ToddTodd Vanilla Staff
    Okay, clicking edit calls post/editcomment which just brings in the html for the form and textbox. The content with the BeforeCommentMeta is not even replaced there.

    You can look in applications/vanilla/views/post/comment.php for a variety of events.
  • TimTim Vanilla Staff
    This was solved on the issue tracker. Simply binding to DiscussionController_BeforeCommentMeta is not enough to catch both instances. You must handle the AJAX render differently, by binding also to PostController_BeforeCommentMeta

    Vanilla Forums COO [GitHub, Twitter, About.me]

Sign In or Register to comment.