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

Fix an issue with destruction of Revision and Diff objects with viewstates

Summary:
See <https://discourse.phabricator-community.org/t/domainexception-when-trying-to-remove-an-differentialrevision/4105>.

These queries aren't actually constructed properly, and destroying a revision or diff with viewstates currently fails.

Test Plan: Used `bin/remove destroy Dxxx` to destroy a revision with viewstates (this also destroys the associated diffs).

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

+4 -2
+2 -1
src/applications/differential/storage/DifferentialDiff.php
··· 737 737 $prop->delete(); 738 738 } 739 739 740 - $viewstates = id(new DifferentialViewStateQuery()) 740 + $viewstate_query = id(new DifferentialViewStateQuery()) 741 741 ->setViewer($viewer) 742 742 ->withObjectPHIDs(array($this->getPHID())); 743 + $viewstates = new PhabricatorQueryIterator($viewstate_query); 743 744 foreach ($viewstates as $viewstate) { 744 745 $viewstate->delete(); 745 746 }
+2 -1
src/applications/differential/storage/DifferentialRevision.php
··· 1033 1033 $dummy_path->getTableName(), 1034 1034 $this->getID()); 1035 1035 1036 - $viewstates = id(new DifferentialViewStateQuery()) 1036 + $viewstate_query = id(new DifferentialViewStateQuery()) 1037 1037 ->setViewer($viewer) 1038 1038 ->withObjectPHIDs(array($this->getPHID())); 1039 + $viewstates = new PhabricatorQueryIterator($viewstate_query); 1039 1040 foreach ($viewstates as $viewstate) { 1040 1041 $viewstate->delete(); 1041 1042 }