Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14021536
D11829.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D11829.diff
View Options
diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php
--- a/src/applications/phriction/controller/PhrictionEditController.php
+++ b/src/applications/phriction/controller/PhrictionEditController.php
@@ -156,10 +156,12 @@
return id(new AphrontRedirectResponse())->setURI($uri);
} catch (PhabricatorApplicationTransactionValidationException $ex) {
$validation_exception = $ex;
- $e_title = $ex->getShortMessage(
- PhrictionTransaction::TYPE_TITLE);
- $e_content = $ex->getShortMessage(
- PhrictionTransaction::TYPE_CONTENT);
+ $e_title = nonempty(
+ $ex->getShortMessage(PhrictionTransaction::TYPE_TITLE),
+ true);
+ $e_content = nonempty(
+ $ex->getShortMessage(PhrictionTransaction::TYPE_CONTENT),
+ true);
// if we're not supposed to process the content version error, then
// overwrite that content...!
diff --git a/src/applications/phriction/editor/PhrictionTransactionEditor.php b/src/applications/phriction/editor/PhrictionTransactionEditor.php
--- a/src/applications/phriction/editor/PhrictionTransactionEditor.php
+++ b/src/applications/phriction/editor/PhrictionTransactionEditor.php
@@ -131,14 +131,16 @@
$dict = array(
'id' => $document->getID(),
'phid' => $document->getPHID(),
- 'content' => $document->getContent()->getContent(),);
+ 'content' => $document->getContent()->getContent(),
+ 'title' => $document->getContent()->getTitle(),);
return $dict;
case PhrictionTransaction::TYPE_MOVE_AWAY:
$document = $xaction->getNewValue();
$dict = array(
'id' => $document->getID(),
'phid' => $document->getPHID(),
- 'content' => $document->getContent()->getContent(),);
+ 'content' => $document->getContent()->getContent(),
+ 'title' => $document->getContent()->getTitle(),);
return $dict;
}
}
@@ -201,7 +203,8 @@
if ($content === '') {
$xactions[] = id(new PhrictionTransaction())
->setTransactionType(PhrictionTransaction::TYPE_DELETE)
- ->setNewValue(true);
+ ->setNewValue(true)
+ ->setMetadataValue('contentDelete', true);
}
break;
case PhrictionTransaction::TYPE_MOVE_TO:
@@ -240,6 +243,7 @@
case PhrictionTransaction::TYPE_MOVE_TO:
$dict = $xaction->getNewValue();
$this->getNewContent()->setContent($dict['content']);
+ $this->getNewContent()->setTitle($dict['title']);
$this->getNewContent()->setChangeType(
PhrictionChangeType::CHANGE_MOVE_HERE);
$this->getNewContent()->setChangeRef($dict['id']);
@@ -603,7 +607,14 @@
case PhrictionTransaction::TYPE_DELETE:
switch ($object->getStatus()) {
case PhrictionDocumentStatus::STATUS_DELETED:
- $e_text = pht('An already deleted document can not be deleted.');
+ if ($xaction->getMetadataValue('contentDelete')) {
+ $e_text = pht(
+ 'This document is already deleted. You must specify '.
+ 'content to re-create the document and make further edits.');
+ } else {
+ $e_text = pht(
+ 'An already deleted document can not be deleted.');
+ }
break;
case PhrictionDocumentStatus::STATUS_MOVED:
$e_text = pht('A moved document can not be deleted.');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 9:49 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6754573
Default Alt Text
D11829.diff (3 KB)
Attached To
Mode
D11829: Phriction - clarify error message when trying to delete already deleted content
Attached
Detach File
Event Timeline
Log In to Comment