Skip to content

Commit cc8cbed

Browse files
author
epriestley
committed
Make "DifferentialDiff->properties" a proper "attachable" property
Summary: See PHI498. This should be initialized to "self::ATTACHABLE" like other attachable properties, but is currently initialized to "array()". Initialize it the normal way and try to catch all code paths which may have accessed it without actually loading and attaching it. Also, remove UI for the very old "excuse" property, which "arc" has not written for well more than a year. Test Plan: Grepped for affected symbols, loaded various revision pages. Somewhat tricky to be 100% sure that every pathway is caught, but it should be obvious if I missed anything once someone hits the code path. Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Differential Revision: https://secure.phabricator.com/D21710
1 parent 387d3b4 commit cc8cbed

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

src/applications/differential/controller/DifferentialRevisionViewController.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ private function buildOperationsBox(DifferentialRevision $revision) {
12821282
}
12831283

12841284
private function buildUnitMessagesView(
1285-
$diff,
1285+
DifferentialDiff $diff,
12861286
DifferentialRevision $revision) {
12871287
$viewer = $this->getViewer();
12881288

@@ -1310,14 +1310,8 @@ private function buildUnitMessagesView(
13101310
return null;
13111311
}
13121312

1313-
$excuse = null;
1314-
if ($diff->hasDiffProperty('arc:unit-excuse')) {
1315-
$excuse = $diff->getProperty('arc:unit-excuse');
1316-
}
1317-
13181313
return id(new HarbormasterUnitSummaryView())
13191314
->setViewer($viewer)
1320-
->setExcuse($excuse)
13211315
->setBuildable($diff->getBuildable())
13221316
->setUnitMessages($diff->getUnitMessages())
13231317
->setLimit(5)

src/applications/differential/storage/DifferentialDiff.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class DifferentialDiff
4242
private $unsavedChangesets = array();
4343
private $changesets = self::ATTACHABLE;
4444
private $revision = self::ATTACHABLE;
45-
private $properties = array();
45+
private $properties = self::ATTACHABLE;
4646
private $buildable = self::ATTACHABLE;
4747

4848
private $unitMessages = self::ATTACHABLE;
@@ -338,6 +338,9 @@ public function attachRevision(DifferentialRevision $revision = null) {
338338
}
339339

340340
public function attachProperty($key, $value) {
341+
if (!is_array($this->properties)) {
342+
$this->properties = array();
343+
}
341344
$this->properties[$key] = $value;
342345
return $this;
343346
}

src/applications/harbormaster/view/HarbormasterUnitSummaryView.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ final class HarbormasterUnitSummaryView extends AphrontView {
55
private $buildable;
66
private $messages;
77
private $limit;
8-
private $excuse;
98
private $showViewAll;
109

1110
public function setBuildable(HarbormasterBuildable $buildable) {
@@ -23,11 +22,6 @@ public function setLimit($limit) {
2322
return $this;
2423
}
2524

26-
public function setExcuse($excuse) {
27-
$this->excuse = $excuse;
28-
return $this;
29-
}
30-
3125
public function setShowViewAll($show_view_all) {
3226
$this->showViewAll = $show_view_all;
3327
return $this;
@@ -88,21 +82,6 @@ public function render() {
8882
$table->setLimit($this->limit);
8983
}
9084

91-
$excuse = $this->excuse;
92-
if (strlen($excuse)) {
93-
$excuse_icon = id(new PHUIIconView())
94-
->setIcon('fa-commenting-o red');
95-
96-
$table->setNotice(
97-
array(
98-
$excuse_icon,
99-
' ',
100-
phutil_tag('strong', array(), pht('Excuse:')),
101-
' ',
102-
$excuse,
103-
));
104-
}
105-
10685
$box->setTable($table);
10786

10887
return $box;

0 commit comments

Comments
 (0)