mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
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:
parent
1f4c3ee167
commit
284bf71a8d
1 changed files with 7 additions and 5 deletions
|
@ -226,12 +226,14 @@ final class DifferentialRevision extends DifferentialDAO {
|
|||
$field->delete();
|
||||
}
|
||||
|
||||
$paths = id(new DifferentialAffectedPath())->loadAllWhere(
|
||||
'revisionID = %d',
|
||||
// we have to do paths a little differentally as they do not have
|
||||
// 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());
|
||||
foreach ($paths as $path) {
|
||||
$path->delete();
|
||||
}
|
||||
|
||||
$result = parent::delete();
|
||||
$this->saveTransaction();
|
||||
|
|
Loading…
Reference in a new issue