@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.

When purging drafts after a transaction edit, purge all drafts

Summary: Fixes T13071. See that task for discusison. I think this `<= version` constraint is needless in normal cases (it should match everything in the table anyway), and slightly harmful in bizarre cases where a draft somehow gets a much larger ID than it should have.

Test Plan:
- Gave a draft an unreasonably large ID.
- Pre-patch, observed: submitting comments on the draft's object does not clear the draft.
- Post-patch: submitting comments on the draft's object now clears the draft correctly.
- Also added comments/actions, reloaded pages, saw drafts stick properly.

Maniphest Tasks: T13071

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

+4 -8
+3 -6
src/applications/draft/storage/PhabricatorVersionedDraft.php
··· 80 80 81 81 public static function purgeDrafts( 82 82 $object_phid, 83 - $viewer_phid, 84 - $version) { 83 + $viewer_phid) { 85 84 86 85 $draft = new PhabricatorVersionedDraft(); 87 86 $conn_w = $draft->establishConnection('w'); 88 87 89 88 queryfx( 90 89 $conn_w, 91 - 'DELETE FROM %T WHERE objectPHID = %s AND authorPHID = %s 92 - AND version <= %d', 90 + 'DELETE FROM %T WHERE objectPHID = %s AND authorPHID = %s', 93 91 $draft->getTableName(), 94 92 $object_phid, 95 - $viewer_phid, 96 - $version); 93 + $viewer_phid); 97 94 } 98 95 99 96 }
+1 -2
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 1985 1985 if (!$is_preview) { 1986 1986 PhabricatorVersionedDraft::purgeDrafts( 1987 1987 $object->getPHID(), 1988 - $viewer->getPHID(), 1989 - $this->loadDraftVersion($object)); 1988 + $viewer->getPHID()); 1990 1989 1991 1990 $draft_engine = $this->newDraftEngine($object); 1992 1991 if ($draft_engine) {