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

Diffusion Commit Search: Fix exception searching for ancestors without repository

Summary:
Do not crash with a vague `count(): Parameter must be an array or an object that implements Countable` exposed to the user when searching for ancestors but having no repository defined, but show the expected error message already defined in the code explaining to the user what to do.

Closes T16144

Test Plan: Go to http://phorge.localhost/diffusion/commit/query/advanced, set "Ancestors Of" to "1", do not set anything in "Repositories", search. Or see T16144 for details.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16144

Differential Revision: https://we.phorge.it/D26129

+1 -1
+1 -1
src/applications/diffusion/query/DiffusionCommitQuery.php
··· 551 551 } 552 552 553 553 if ($this->ancestorsOf !== null) { 554 - if (count($this->repositoryIDs) !== 1) { 554 + if ($this->repositoryIDs === null || count($this->repositoryIDs) !== 1) { 555 555 throw new PhabricatorSearchConstraintException( 556 556 pht( 557 557 'To search for commits which are ancestors of particular refs, '.