@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 text-mode rendering of object and Asana link views

Summary:
Ref T2852. Two issues:

- Embeds (`T12`, `{T12}`) have some handle issues because handles run afoul of visibility checks under some configs. Make handles unconditionally visible.
- Asana links don't render correctly into text mode. Give them a valid text mode rendering so they don't flip out.

Test Plan: Made comments with `T12` and `http://app.asana.com/...` and published them to Asana.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2852

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

+17 -11
+10 -6
src/applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleAsana.php
··· 61 61 'id' => $tag_id, 62 62 ) + $spec['tag']; 63 63 64 - $view = id(new PhabricatorTagView()) 65 - ->setID($tag_id) 66 - ->setName($spec['href']) 67 - ->setHref($spec['href']) 68 - ->setType(PhabricatorTagView::TYPE_OBJECT) 69 - ->setExternal(true); 64 + if ($this->getEngine()->isTextMode()) { 65 + $view = $spec['href']; 66 + } else { 67 + $view = id(new PhabricatorTagView()) 68 + ->setID($tag_id) 69 + ->setName($spec['href']) 70 + ->setHref($spec['href']) 71 + ->setType(PhabricatorTagView::TYPE_OBJECT) 72 + ->setExternal(true); 73 + } 70 74 71 75 $engine->overwriteStoredText($spec['token'], $view); 72 76 }
+3 -1
src/applications/phid/PhabricatorObjectHandle.php
··· 231 231 } 232 232 233 233 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 234 - return false; 234 + // NOTE: Handles are always visible, they just don't get populated with 235 + // data if the user can't see the underlying object. 236 + return true; 235 237 } 236 238 237 239 }
+4 -4
src/infrastructure/markup/rule/PhabricatorRemarkupRuleObject.php
··· 26 26 27 27 protected function loadHandles(array $objects) { 28 28 $phids = mpull($objects, 'getPHID'); 29 - $query = new PhabricatorObjectHandleData($phids); 30 29 31 - $viewer = $this->getEngine()->getConfig('viewer'); 32 - $query->setViewer($viewer); 33 - $handles = $query->loadHandles(); 30 + $handles = id(new PhabricatorHandleQuery($phids)) 31 + ->withPHIDs($phids) 32 + ->setViewer($this->getEngine()->getConfig('viewer')) 33 + ->execute(); 34 34 35 35 $result = array(); 36 36 foreach ($objects as $id => $object) {