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

Fix exception trying to export empty task list to CSV

Summary:
Check that we have objects with PHIDs before running a query. If there are none, return an empty array instead.

```
EXCEPTION: (Exception) Edge list passed to "withSourcePHIDs(...)" is empty, but it must be nonempty. at [<phorge>/src/infrastructure/edges/query/PhabricatorEdgeQuery.php:50]
```

Closes T15789

Test Plan:
* Log into Phorge, go to http://phorge.localhost/maniphest/query/assigned/ and make sure you have zero assigned tasks.
* Click "Use Results" and select "Export Data".
* In the "Export Results" dialog, keep default Format = csv and click "Download Data".
* After applying the patch, get the expected dialog "Download File - Download file assigned.csv (264 B)?" and resulting file with only column headers and no data, instead of an unhandled exception.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15789

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

+6
+3
src/infrastructure/export/engine/PhabricatorProjectsExportEngineExtension.php
··· 24 24 $viewer = $this->getViewer(); 25 25 26 26 $object_phids = mpull($objects, 'getPHID'); 27 + if (!$object_phids) { 28 + return array(); 29 + } 27 30 28 31 $projects_query = id(new PhabricatorEdgeQuery()) 29 32 ->withSourcePHIDs($object_phids)
+3
src/infrastructure/export/engine/PhabricatorSubscriptionsExportEngineExtension.php
··· 24 24 $viewer = $this->getViewer(); 25 25 26 26 $object_phids = mpull($objects, 'getPHID'); 27 + if (!$object_phids) { 28 + return array(); 29 + } 27 30 28 31 $projects_query = id(new PhabricatorEdgeQuery()) 29 32 ->withSourcePHIDs($object_phids)