@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 some more setIcon() issues

Summary: Fixes T11569. This fixes a known bad `setIcon()`. I also looked for more calls to `setIcon()` without success, and stubbed `setIcon()` so we're in good shape even if more exist.

Test Plan:
- Grepped for `setIcon(` and manually inspect all 1,004 callsites to look for calls on `PHUIObjectItemView` objects.
- Grepped for "high risk" callsites (`setIcon` in file after `PHUIObjectItemView`) and re-examined them. I identified these files with this command:

```
git ls-tree -r --name-only HEAD | xargs pcregrep -i -M -H -c --files-with-matches -o 'PHUIObjectItemView(.|\n)*setIcon'
```

There might be some more clever way to do that.
- Since this only identified the callsites I already knew about and I don't have a ton of confidence that I didn't miss any, I put a stub in place that logs a deprecation warning. I'll file a followup to go clean these up in a month or so if the logs are clean.
- Loaded Nuance, saw it work but warn.
- Changed Nuance to use `setStatusIcon()`, loaded Nuance, no more fatal.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11569

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

+15 -3
+3 -3
src/applications/nuance/controller/NuanceConsoleController.php
··· 16 16 id(new PHUIObjectItemView()) 17 17 ->setHeader(pht('Queues')) 18 18 ->setHref($this->getApplicationURI('queue/')) 19 - ->setIcon('fa-align-left') 19 + ->setImageIcon('fa-align-left') 20 20 ->addAttribute(pht('Manage Nuance queues.'))); 21 21 22 22 $menu->addItem( 23 23 id(new PHUIObjectItemView()) 24 24 ->setHeader(pht('Sources')) 25 25 ->setHref($this->getApplicationURI('source/')) 26 - ->setIcon('fa-filter') 26 + ->setImageIcon('fa-filter') 27 27 ->addAttribute(pht('Manage Nuance sources.'))); 28 28 29 29 $menu->addItem( 30 30 id(new PHUIObjectItemView()) 31 31 ->setHeader(pht('Items')) 32 32 ->setHref($this->getApplicationURI('item/')) 33 - ->setIcon('fa-clone') 33 + ->setImageIcon('fa-clone') 34 34 ->addAttribute(pht('Manage Nuance items.'))); 35 35 36 36 $crumbs = $this->buildApplicationCrumbs();
+12
src/view/phui/PHUIObjectItemView.php
··· 171 171 return $this; 172 172 } 173 173 174 + /** 175 + * This method has been deprecated, use @{method:setImageIcon} instead. 176 + * 177 + * @deprecated 178 + */ 179 + public function setIcon($icon) { 180 + phlog( 181 + pht('Deprecated call to setIcon(), use setImageIcon() instead.')); 182 + 183 + return $this->setImageIcon($icon); 184 + } 185 + 174 186 public function setStatusIcon($icon, $label = null) { 175 187 $this->statusIcon = array( 176 188 'icon' => $icon,