Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14035494
D9249.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
D9249.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
@@ -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
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 11, 6:13 AM (1 w, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715289
Default Alt Text
D9249.diff (3 KB)
Attached To
Mode
D9249: Don't warn about conflicts when reverting Phriction documents
Attached
Detach File
Event Timeline
Log In to Comment