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

Disambiguate isEmpty()

Summary:
Fixes T10250.

Rename the one I added to `hasAnyProperties()` for clarity.

Test Plan:
- Viewed a project profile with content.
- Viewed a project profile with no properties.
- Viewed a workboard with tasks that had a mixture of additional projects and no additional projects.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10250

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

+10 -15
+1 -1
src/applications/people/controller/PhabricatorPeopleProfileViewController.php
··· 112 112 PhabricatorCustomField::ROLE_VIEW); 113 113 $field_list->appendFieldsToPropertyList($user, $viewer, $view); 114 114 115 - if ($view->isEmpty()) { 115 + if (!$view->hasAnyProperties()) { 116 116 return null; 117 117 } 118 118
+1 -1
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 125 125 PhabricatorCustomField::ROLE_VIEW); 126 126 $field_list->appendFieldsToPropertyList($project, $viewer, $view); 127 127 128 - if ($view->isEmpty()) { 128 + if (!$view->hasAnyProperties()) { 129 129 return null; 130 130 } 131 131
+5 -6
src/applications/project/view/ProjectBoardTaskCard.php
··· 86 86 $project_phids = array_fuse($task->getProjectPHIDs()); 87 87 unset($project_phids[$this->project->getPHID()]); 88 88 89 - $handle_list = $viewer->loadHandles($project_phids); 90 - $tag_list = id(new PHUIHandleTagListView()) 91 - ->setSlim(true) 92 - ->setHandles($handle_list); 93 - 94 - if (!$tag_list->isEmpty()) { 89 + if ($project_phids) { 90 + $handle_list = $viewer->loadHandles($project_phids); 91 + $tag_list = id(new PHUIHandleTagListView()) 92 + ->setSlim(true) 93 + ->setHandles($handle_list); 95 94 $card->addAttribute($tag_list); 96 95 } 97 96
-4
src/view/AphrontTagView.php
··· 77 77 return $this->id; 78 78 } 79 79 80 - public function isEmpty() { 81 - return empty($this->getTagContent()); 82 - } 83 - 84 80 protected function getTagName() { 85 81 return 'div'; 86 82 }
+3 -3
src/view/phui/PHUIPropertyListView.php
··· 115 115 $this->invokedWillRenderEvent = true; 116 116 } 117 117 118 - public function isEmpty() { 118 + public function hasAnyProperties() { 119 119 $this->invokeWillRenderEvent(); 120 120 121 121 if ($this->parts) { 122 - return false; 122 + return true; 123 123 } 124 124 125 - return true; 125 + return false; 126 126 } 127 127 128 128 public function render() {