Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13997661
D13665.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13665.diff
View Options
diff --git a/src/applications/differential/controller/DifferentialInlineCommentEditController.php b/src/applications/differential/controller/DifferentialInlineCommentEditController.php
--- a/src/applications/differential/controller/DifferentialInlineCommentEditController.php
+++ b/src/applications/differential/controller/DifferentialInlineCommentEditController.php
@@ -131,11 +131,26 @@
protected function deleteComment(PhabricatorInlineCommentInterface $inline) {
$inline->openTransaction();
+
+ $inline->setIsDeleted(1)->save();
DifferentialDraft::deleteHasDraft(
$inline->getAuthorPHID(),
$inline->getRevisionPHID(),
$inline->getPHID());
- $inline->delete();
+
+ $inline->saveTransaction();
+ }
+
+ protected function undeleteComment(
+ PhabricatorInlineCommentInterface $inline) {
+ $inline->openTransaction();
+
+ $inline->setIsDeleted(0)->save();
+ DifferentialDraft::markHasDraft(
+ $inline->getAuthorPHID(),
+ $inline->getRevisionPHID(),
+ $inline->getPHID());
+
$inline->saveTransaction();
}
diff --git a/src/applications/diffusion/controller/DiffusionInlineCommentController.php b/src/applications/diffusion/controller/DiffusionInlineCommentController.php
--- a/src/applications/diffusion/controller/DiffusionInlineCommentController.php
+++ b/src/applications/diffusion/controller/DiffusionInlineCommentController.php
@@ -108,7 +108,12 @@
}
protected function deleteComment(PhabricatorInlineCommentInterface $inline) {
- return $inline->delete();
+ $inline->setIsDeleted(1)->save();
+ }
+
+ protected function undeleteComment(
+ PhabricatorInlineCommentInterface $inline) {
+ $inline->setIsDeleted(0)->save();
}
protected function saveComment(PhabricatorInlineCommentInterface $inline) {
diff --git a/src/infrastructure/diff/PhabricatorInlineCommentController.php b/src/infrastructure/diff/PhabricatorInlineCommentController.php
--- a/src/infrastructure/diff/PhabricatorInlineCommentController.php
+++ b/src/infrastructure/diff/PhabricatorInlineCommentController.php
@@ -12,6 +12,8 @@
PhabricatorInlineCommentInterface $inline);
abstract protected function deleteComment(
PhabricatorInlineCommentInterface $inline);
+ abstract protected function undeleteComment(
+ PhabricatorInlineCommentInterface $inline);
abstract protected function saveComment(
PhabricatorInlineCommentInterface $inline);
@@ -167,7 +169,12 @@
$is_delete = ($op == 'delete' || $op == 'refdelete');
$inline = $this->loadCommentForEdit($this->getCommentID());
- $inline->setIsDeleted((int)$is_delete)->save();
+
+ if ($is_delete) {
+ $this->deleteComment($inline);
+ } else {
+ $this->undeleteComment($inline);
+ }
return $this->buildEmptyResponse();
case 'edit':
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 25, 5:33 AM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6719008
Default Alt Text
D13665.diff (2 KB)
Attached To
Mode
D13665: Correctly clear draft markers when deleting an inline comment
Attached
Detach File
Event Timeline
Log In to Comment