Fix error when deleting revision
Summary: DifferentialAffectedPath has no id or phid key so delete() won't work and we have to do things this other way. Test Plan: deleted a few diffs on my test reproduction. aside from warnings about missing keys (epriestley is on it as I write this) no errors found and diff observed as deleted Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1846 Differential Revision: https://secure.phabricator.com/D3610
This commit is contained in:
@@ -226,12 +226,14 @@ final class DifferentialRevision extends DifferentialDAO {
|
|||||||
$field->delete();
|
$field->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
$paths = id(new DifferentialAffectedPath())->loadAllWhere(
|
// we have to do paths a little differentally as they do not have
|
||||||
'revisionID = %d',
|
// an id or phid column for delete() to act on
|
||||||
|
$dummy_path = new DifferentialAffectedPath();
|
||||||
|
queryfx(
|
||||||
|
$conn_w,
|
||||||
|
'DELETE FROM %T WHERE revisionID = %d',
|
||||||
|
$dummy_path->getTableName(),
|
||||||
$this->getID());
|
$this->getID());
|
||||||
foreach ($paths as $path) {
|
|
||||||
$path->delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = parent::delete();
|
$result = parent::delete();
|
||||||
$this->saveTransaction();
|
$this->saveTransaction();
|
||||||
|
|||||||
Reference in New Issue
Block a user