Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Does Q2A throw an event when a post is edited within a few minutes?

+1 vote
219 views
asked Oct 29, 2011 in Q2A Core by Scott
edited Oct 30, 2011 by Scott
I know that when you edit a post within a few minutes (5? 10?) of posting, it doesn't register it as an edit on the site. Does it throw the q_edit or a_edit event?

2 Answers

+1 vote
answered Oct 30, 2011 by gidgreen

It does register it as an edit in the database, but it doesn't show it as an edit in the interface. See the condition starting isset($post['updated'])... at the end of qa_post_html_fields(...) in qa-app-format.php

So by the same measure, it does throw an event, but you can perform a similar check in your event module, if you want to match the interface's behavior.

+1 vote
answered Oct 30, 2011 by NoahY
Yep, sure does... I would guess it registers as an edit as well, but just doesn't show up, due to some check in the display function.  Here's the report call:

        qa_report_event('q_edit', $userid, $handle, $cookieid, array(
            'postid' => $oldquestion['postid'],
            'title' => $title,
            'content' => $content,
            'format' => $format,
            'text' => $text,
            'tags' => $tagstring,
            'oldtitle' => $oldquestion['title'],
            'oldcontent' => $oldquestion['content'],
            'oldformat' => $oldquestion['format'],
            'oldtags' => $oldquestion['tags'],
        ));

in qa-include/qa-app-post-update.php, and it gets called even for edits right after posts.
...