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

Don't try to emit project board update events if there are no projects to update

Summary: Ref T4900. We may execute a bad query here if the task has no projects at all.

Test Plan: Edited a task with no new or old projects. Instead of an exception, things worked.

Maniphest Tasks: T4900

Differential Revision: https://secure.phabricator.com/D20689

+23 -21
+23 -21
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 879 879 $project_phids = array_fuse($old_phids) + array_fuse($new_phids); 880 880 $project_phids = array_keys($project_phids); 881 881 882 - $projects = id(new PhabricatorProjectQuery()) 883 - ->setViewer(PhabricatorUser::getOmnipotentUser()) 884 - ->withPHIDs($project_phids) 885 - ->execute(); 882 + if ($project_phids) { 883 + $projects = id(new PhabricatorProjectQuery()) 884 + ->setViewer(PhabricatorUser::getOmnipotentUser()) 885 + ->withPHIDs($project_phids) 886 + ->execute(); 886 887 887 - $notify_projects = array(); 888 - foreach ($projects as $project) { 889 - $notify_projects[$project->getPHID()] = $project; 890 - foreach ($project->getAncestorProjects() as $ancestor) { 891 - $notify_projects[$ancestor->getPHID()] = $ancestor; 888 + $notify_projects = array(); 889 + foreach ($projects as $project) { 890 + $notify_projects[$project->getPHID()] = $project; 891 + foreach ($project->getAncestorProjects() as $ancestor) { 892 + $notify_projects[$ancestor->getPHID()] = $ancestor; 893 + } 892 894 } 893 - } 894 895 895 - foreach ($notify_projects as $key => $project) { 896 - if (!$project->getHasWorkboard()) { 897 - unset($notify_projects[$key]); 896 + foreach ($notify_projects as $key => $project) { 897 + if (!$project->getHasWorkboard()) { 898 + unset($notify_projects[$key]); 899 + } 898 900 } 899 - } 900 901 901 - $notify_phids = array_keys($notify_projects); 902 + $notify_phids = array_keys($notify_projects); 902 903 903 - if ($notify_phids) { 904 - $data = array( 905 - 'type' => 'workboards', 906 - 'subscribers' => $notify_phids, 907 - ); 904 + if ($notify_phids) { 905 + $data = array( 906 + 'type' => 'workboards', 907 + 'subscribers' => $notify_phids, 908 + ); 908 909 909 - PhabricatorNotificationClient::tryToPostMessage($data); 910 + PhabricatorNotificationClient::tryToPostMessage($data); 911 + } 910 912 } 911 913 } 912 914