@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add very basic conflict detection to Phriction

Summary: Ref T4768. This is extremely basic, but will stop conflicts from going silently unnoticed.

Test Plan: {F156219}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4768

Differential Revision: https://secure.phabricator.com/D9167

+31
+31
src/applications/phriction/controller/PhrictionEditController.php
··· 93 93 $errors = array(); 94 94 95 95 if ($request->isFormPost()) { 96 + 97 + $overwrite = $request->getBool('overwrite'); 98 + if (!$overwrite) { 99 + $edit_version = $request->getStr('contentVersion'); 100 + $current_version = $content->getVersion(); 101 + if ($edit_version != $current_version) { 102 + $dialog = $this->newDialog() 103 + ->setTitle(pht('Edit Conflict!')) 104 + ->appendParagraph( 105 + pht( 106 + 'Another user made changes to this document after you began '. 107 + 'editing it. Do you want to overwrite their changes?')) 108 + ->appendParagraph( 109 + pht( 110 + 'If you choose to overwrite their changes, you should review '. 111 + 'the document edit history to see what you overwrote, and '. 112 + 'then make another edit to merge the changes if necessary.')) 113 + ->addSubmitButton(pht('Overwrite Changes')) 114 + ->addCancelButton($request->getRequestURI()); 115 + 116 + $dialog->addHiddenInput('overwrite', 'true'); 117 + foreach ($request->getPassthroughRequestData() as $key => $value) { 118 + $dialog->addHiddenInput($key, $value); 119 + } 120 + 121 + return $dialog; 122 + } 123 + } 124 + 125 + 96 126 $title = $request->getStr('title'); 97 127 $notes = $request->getStr('description'); 98 128 ··· 192 222 ->setAction($request->getRequestURI()->getPath()) 193 223 ->addHiddenInput('slug', $document->getSlug()) 194 224 ->addHiddenInput('nodraft', $request->getBool('nodraft')) 225 + ->addHiddenInput('contentVersion', $content->getVersion()) 195 226 ->appendChild( 196 227 id(new AphrontFormTextControl()) 197 228 ->setLabel(pht('Title'))