Index: branches/5.3.x/units/poll_comments/poll_comment_eh.php =================================================================== diff -u -r15694 -r15898 --- branches/5.3.x/units/poll_comments/poll_comment_eh.php (.../poll_comment_eh.php) (revision 15694) +++ branches/5.3.x/units/poll_comments/poll_comment_eh.php (.../poll_comment_eh.php) (revision 15898) @@ -1,6 +1,6 @@ Array ('self' => true, 'subitem' => true,), + 'OnCreateAjax' => Array ('self' => true, 'subitem' => true,), 'OnItemBuild' => Array ('self' => true, 'subitem' => true,), ); @@ -103,7 +103,7 @@ if ( $spam_helper->InSpamControl() ) { $event->status = kEvent::erFAIL; - $object->SetError('CommentText', 'too_frequent', 'lu_error_AlreadyCommented'); + $object->SetError('CommentBody', 'too_frequent', 'lu_error_AlreadyCommented'); return ; } @@ -132,11 +132,26 @@ if ( !$this->Application->isAdmin && $event->status == kEvent::erSUCCESS ) { $event->setRedirectParam('opener', 's'); $event->setRedirectParam('pass', 'm,poll'); - $event->redirect = $this->Application->GetVar('success_template'); } } /** + * Wrapper for OnCreate event + * + * @param kEvent $event + * + * @return void + * @access protected + */ + protected function OnCreateAjax(kEvent $event) + { + $ajax_form_helper = $this->Application->recallObject('AjaxFormHelper'); + /* @var $ajax_form_helper AjaxFormHelper */ + + $ajax_form_helper->transitEvent($event, 'OnCreate'); + } + + /** * Protects against spam * * @param kEvent $event