Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/PhabricatorInlineCommentController.php
Show First 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | switch ($op) { | ||||
$inline->setFixedState($fixed_state); | $inline->setFixedState($fixed_state); | ||||
} | } | ||||
} | } | ||||
if ($this->hasContentState()) { | if ($this->hasContentState()) { | ||||
$this->updateCommentContentState($inline); | $this->updateCommentContentState($inline); | ||||
} | } | ||||
// NOTE: We're writing the comment as "deleted", then reloading to | |||||
// pick up context and undeleting it. This is silly -- we just want | |||||
// to load and attach context -- but just loading context is currently | |||||
// complicated (for example, context relies on cache keys that expect | |||||
// the inline to have an ID). | |||||
$inline->setIsDeleted(1); | |||||
$this->saveComment($inline); | $this->saveComment($inline); | ||||
// Reload the inline to attach context. | // Reload the inline to attach context. | ||||
$inline = $this->loadCommentByIDForEdit($inline->getID()); | $inline = $this->loadCommentByIDForEdit($inline->getID()); | ||||
// Now, we can read the source file and set the initial state. | |||||
$state = $inline->getContentState(); | |||||
$default_suggestion = $inline->getDefaultSuggestionText(); | |||||
$state->setContentSuggestionText($default_suggestion); | |||||
$inline->setContentState($state); | |||||
$inline->setIsDeleted(0); | |||||
$this->saveComment($inline); | |||||
$edit_dialog = $this->buildEditDialog($inline); | $edit_dialog = $this->buildEditDialog($inline); | ||||
if ($this->getOperation() == 'reply') { | if ($this->getOperation() == 'reply') { | ||||
$edit_dialog->setTitle(pht('Reply to Inline Comment')); | $edit_dialog->setTitle(pht('Reply to Inline Comment')); | ||||
} else { | } else { | ||||
$edit_dialog->setTitle(pht('New Inline Comment')); | $edit_dialog->setTitle(pht('New Inline Comment')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines |