Index: modules/in-bulletin/units/poll_comments/poll_comment_eh.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- modules/in-bulletin/units/poll_comments/poll_comment_eh.php (revision 15788) +++ modules/in-bulletin/units/poll_comments/poll_comment_eh.php (revision ) @@ -28,7 +28,7 @@ parent::mapPermissions(); $permissions = Array ( - 'OnCreate' => Array ('self' => true, 'subitem' => true,), + 'OnCreateAjax' => Array ('self' => true, 'subitem' => true,), 'OnItemBuild' => Array ('self' => true, 'subitem' => true,), ); @@ -101,7 +101,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 ; } @@ -130,8 +130,23 @@ 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'); } /** \ No newline at end of file