Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | if ($convert_objects) { | ||||
continue; | continue; | ||||
} | } | ||||
// For other inlines: if they have a nonempty draft state, set their | // For other inlines: if they have a nonempty draft state, set their | ||||
// content to the draft state content. We want to submit the comment | // content to the draft state content. We want to submit the comment | ||||
// as it is currently shown to the user, not as it was stored the last | // as it is currently shown to the user, not as it was stored the last | ||||
// time they clicked "Save". | // time they clicked "Save". | ||||
$draft_content = $inline->getContentForEdit($viewer); | $draft_state = $inline->getContentStateForEdit($viewer); | ||||
if (strlen($draft_content)) { | if (!$draft_state->isEmptyContentState()) { | ||||
$inline->setContent($draft_content); | $inline->setContentState($draft_state); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// If we're loading publishable comments, discard any comments that are | // If we're loading publishable comments, discard any comments that are | ||||
// empty. | // empty. | ||||
if ($drop_void) { | if ($drop_void) { | ||||
foreach ($inlines as $key => $inline) { | foreach ($inlines as $key => $inline) { | ||||
Show All 19 Lines |