mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Fix incorrect error message when a document/comment is voted/blamed already #2590
This commit is contained in:
parent
316cfc43b0
commit
08fc4d72d9
3 changed files with 39 additions and 10 deletions
|
|
@ -1606,9 +1606,16 @@ class CommentController extends Comment
|
|||
}
|
||||
|
||||
// invalid vote if vote info exists in the session info.
|
||||
if(!empty($_SESSION['voted_comment'][$comment_srl]))
|
||||
if (!empty($_SESSION['voted_comment'][$comment_srl]))
|
||||
{
|
||||
return new BaseObject(-1, $failed_voted . '_already');
|
||||
if ($_SESSION['voted_comment'][$comment_srl] > 0)
|
||||
{
|
||||
return new BaseObject(-1, 'failed_voted_already');
|
||||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'failed_blamed_already');
|
||||
}
|
||||
}
|
||||
|
||||
// Get the original comment
|
||||
|
|
@ -1649,10 +1656,17 @@ class CommentController extends Comment
|
|||
$output = executeQuery('comment.getCommentVotedLogInfo', $args);
|
||||
|
||||
// Pass after registering a session if log information has vote-up logs
|
||||
if($output->data->count)
|
||||
if ($output->data->count)
|
||||
{
|
||||
$_SESSION['voted_comment'][$comment_srl] = false;
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
$_SESSION['voted_comment'][$comment_srl] = intval($output->data->point);
|
||||
if ($output->data->point > 0)
|
||||
{
|
||||
return new BaseObject(-1, 'failed_voted_already');
|
||||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'failed_blamed_already');
|
||||
}
|
||||
}
|
||||
|
||||
// Call a trigger (before)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
<column name="sum(point)" alias="point" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" />
|
||||
|
|
|
|||
|
|
@ -2027,9 +2027,16 @@ class DocumentController extends Document
|
|||
}
|
||||
|
||||
// Return fail if session already has information about votes
|
||||
if(!empty($_SESSION['voted_document'][$document_srl]))
|
||||
if (!empty($_SESSION['voted_document'][$document_srl]))
|
||||
{
|
||||
return new BaseObject(-1, $failed_voted . '_already');
|
||||
if ($_SESSION['voted_document'][$document_srl] > 0)
|
||||
{
|
||||
return new BaseObject(-1, 'failed_voted_already');
|
||||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'failed_blamed_already');
|
||||
}
|
||||
}
|
||||
|
||||
// Get the original document
|
||||
|
|
@ -2070,10 +2077,17 @@ class DocumentController extends Document
|
|||
$output = executeQuery('document.getDocumentVotedLogInfo', $args);
|
||||
|
||||
// Pass after registering a session if log information has vote-up logs
|
||||
if($output->data->count)
|
||||
if ($output->data->count)
|
||||
{
|
||||
$_SESSION['voted_document'][$document_srl] = false;
|
||||
return new BaseObject(-1, $failed_voted);
|
||||
$_SESSION['voted_document'][$document_srl] = intval($output->data->point);
|
||||
if ($output->data->point > 0)
|
||||
{
|
||||
return new BaseObject(-1, 'failed_voted_already');
|
||||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'failed_blamed_already');
|
||||
}
|
||||
}
|
||||
|
||||
// Call a trigger (before)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue