Index: branches/5.3.x/units/polls/poll_eh.php =================================================================== diff -u -N -r15670 -r15694 --- branches/5.3.x/units/polls/poll_eh.php (.../poll_eh.php) (revision 15670) +++ branches/5.3.x/units/polls/poll_eh.php (.../poll_eh.php) (revision 15694) @@ -1,6 +1,6 @@ Conn->Query($sql); - $poll_answers_table = $this->Application->getUnitOption('poll-answer', 'TableName'); + $poll_answers_table = $this->Application->getUnitConfig('poll-answer')->getTableName(); $poll_answers_table = $this->Application->GetTempName($poll_answers_table); - $sql = 'UPDATE '.$poll_answers_table.' SET VotesQty = 0 - WHERE '.$object->IDField.' = '.$object->GetID(); + $sql = 'UPDATE '.$poll_answers_table.' + SET VotesQty = 0 + WHERE '.$object->IDField.' = '.$object->GetID(); $this->Conn->Query($sql); } @@ -137,15 +138,22 @@ $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PollsStatistics'); - $poll_table = $this->Application->getUnitOption('poll', 'TableName'); - $this->Conn->Query('UPDATE '.$poll_table.' SET CachedVotesQty = CachedVotesQty + 1 - WHERE PollId = '.$object->GetID()); + $poll_table = $this->Application->getUnitConfig('poll')->getTableName(); + $sql = 'UPDATE ' . $poll_table . ' + SET CachedVotesQty = CachedVotesQty + 1 + WHERE PollId = ' . $object->GetID(); + $this->Conn->Query($sql); + // update table with answers - $poll_answers_table = $this->Application->getUnitOption('poll-answer', 'TableName'); - $this->Conn->Query('UPDATE '.$poll_answers_table.' SET VotesQty = VotesQty + 1 - WHERE PollId = '.$object->GetID().' AND AnswerId = '.$poll_answer_id); + $poll_answers_table = $this->Application->getUnitConfig('poll-answer')->getTableName(); + + $sql = 'UPDATE ' . $poll_answers_table . ' + SET VotesQty = VotesQty + 1 + WHERE PollId = ' . $object->GetID() . ' AND AnswerId = ' . $poll_answer_id; + $this->Conn->Query($sql); } + $event->setEventParam('PollId', $this->Application->GetVar('poll_id')); $event->redirect = false; }