Fix Owners lookups for the repository root
Summary: Ref T9201. At the root of a repository the current path is `null`, but the OwnersQuery wants strings. This could be resolved a couple different ways, but just cast the arguments to strings since that seems reasonable enough. Test Plan: Browsed root of a repository. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9201 Differential Revision: https://secure.phabricator.com/D13919
This commit is contained in:
		| @@ -183,8 +183,6 @@ abstract class DiffusionBrowseController extends DiffusionController { | |||||||
|         $ownership = id(new PHUIStatusListView()) |         $ownership = id(new PHUIStatusListView()) | ||||||
|           ->setUser($viewer); |           ->setUser($viewer); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|         foreach ($packages as $package) { |         foreach ($packages as $package) { | ||||||
|           $icon = 'fa-list-alt'; |           $icon = 'fa-list-alt'; | ||||||
|           $color = 'grey'; |           $color = 'grey'; | ||||||
|   | |||||||
| @@ -42,6 +42,7 @@ final class PhabricatorOwnersPackageQuery | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     foreach ($paths as $path) { |     foreach ($paths as $path) { | ||||||
|  |       $path = (string)$path; | ||||||
|       $this->controlMap[$repository_phid][$path] = $path; |       $this->controlMap[$repository_phid][$path] = $path; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -277,6 +278,8 @@ final class PhabricatorOwnersPackageQuery | |||||||
|    * @return list<PhabricatorOwnersPackage> List of controlling packages. |    * @return list<PhabricatorOwnersPackage> List of controlling packages. | ||||||
|    */ |    */ | ||||||
|   public function getControllingPackagesForPath($repository_phid, $path) { |   public function getControllingPackagesForPath($repository_phid, $path) { | ||||||
|  |     $path = (string)$path; | ||||||
|  |  | ||||||
|     if (!isset($this->controlMap[$repository_phid][$path])) { |     if (!isset($this->controlMap[$repository_phid][$path])) { | ||||||
|       throw new PhutilInvalidStateException('withControl'); |       throw new PhutilInvalidStateException('withControl'); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 epriestley
					epriestley