diff --git a/src/applications/owners/query/PhabricatorOwnersPackageQuery.php b/src/applications/owners/query/PhabricatorOwnersPackageQuery.php --- a/src/applications/owners/query/PhabricatorOwnersPackageQuery.php +++ b/src/applications/owners/query/PhabricatorOwnersPackageQuery.php @@ -129,7 +129,16 @@ } if ($this->controlMap) { - $this->controlResults += mpull($packages, null, 'getID'); + foreach ($packages as $package) { + // If this package is archived, it's no longer a controlling package + // for any path. In particular, it can not force active packages with + // weak dominion to give up control. + if ($package->isArchived()) { + continue; + } + + $this->controlResults[$package->getID()] = $package; + } } return $packages; @@ -361,13 +370,6 @@ $best_match = null; $include = false; - // If this package is archived, it's no longer a controlling package - // for the given path. In particular, it can not force active packages - // with weak dominion to give up control. - if ($package->isArchived()) { - continue; - } - $repository_paths = $package->getPathsForRepository($repository_phid); foreach ($repository_paths as $package_path) { $strength = $package_path->getPathMatchStrength(