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.
Options

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

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

    https://github.com/vanillaforums/Garden/issues
  • Options
    ToddTodd Chief Product Officer 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.
  • Options
    TimTim Operations 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.