Page MenuHomePhabricator

D9249.diff
No OneTemporary

D9249.diff

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
@@ -14,10 +14,12 @@
$request = $this->getRequest();
$user = $request->getUser();
+ $current_version = null;
if ($this->id) {
$document = id(new PhrictionDocumentQuery())
->setViewer($user)
->withIDs(array($this->id))
+ ->needContent(true)
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
@@ -28,6 +30,8 @@
return new Aphront404Response();
}
+ $current_version = $document->getContent()->getVersion();
+
$revert = $request->getInt('revert');
if ($revert) {
$content = id(new PhrictionContent())->loadOneWhere(
@@ -38,7 +42,7 @@
return new Aphront404Response();
}
} else {
- $content = id(new PhrictionContent())->load($document->getContentID());
+ $content = $document->getContent();
}
} else {
@@ -56,6 +60,7 @@
if ($document) {
$content = $document->getContent();
+ $current_version = $content->getVersion();
} else {
if (PhrictionDocument::isProjectSlug($slug)) {
$project = id(new PhabricatorProjectQuery())
@@ -104,7 +109,6 @@
$overwrite = $request->getBool('overwrite');
if (!$overwrite) {
$edit_version = $request->getStr('contentVersion');
- $current_version = $content->getVersion();
if ($edit_version != $current_version) {
$dialog = $this->newDialog()
->setTitle(pht('Edit Conflict!'))
@@ -229,7 +233,7 @@
->setAction($request->getRequestURI()->getPath())
->addHiddenInput('slug', $document->getSlug())
->addHiddenInput('nodraft', $request->getBool('nodraft'))
- ->addHiddenInput('contentVersion', $content->getVersion())
+ ->addHiddenInput('contentVersion', $current_version)
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Title'))
diff --git a/src/applications/phriction/controller/PhrictionHistoryController.php b/src/applications/phriction/controller/PhrictionHistoryController.php
--- a/src/applications/phriction/controller/PhrictionHistoryController.php
+++ b/src/applications/phriction/controller/PhrictionHistoryController.php
@@ -108,25 +108,27 @@
if ($vs_previous) {
$item->addIcon(
- 'arrow_left',
+ 'fa-reply',
pht('Show Change'),
array(
'href' => $vs_previous,
));
} else {
- $item->addIcon('arrow_left-grey',
+ $item->addIcon(
+ 'fa-reply grey',
phutil_tag('em', array(), pht('No previous change')));
}
if ($vs_head) {
$item->addIcon(
- 'merge',
+ 'fa-reply-all',
pht('Show Later Changes'),
array(
'href' => $vs_head,
));
} else {
- $item->addIcon('merge-grey',
+ $item->addIcon(
+ 'fa-reply-all grey',
phutil_tag('em', array(), pht('No later changes')));
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 10, 7:17 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715289
Default Alt Text
D9249.diff (3 KB)

Event Timeline