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

Remove extra container tag on HandleListViews rendering from ModularTransactions in text mode

Summary:
Fixes T12082. Ref T11114. When modular transaction render a handle list, they use HandleListView, which has a text mode.

However, the HandleListView is a TagView, and currently TagViews always render a tag of some kind. Allow them to return `null` to decline to render any tag.

Test Plan:
- Added a pile of debugging stuff to `ApplicationTransactionEditor` to throw during mail generation.
- Added a reviewer to a revision.
- Used `bin/worker execute --id ...` to hit the mail generation repeatedly.
- Before patch: mail generated with a <span>, even in text mode.
- After patch: clean mail generation.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12082, T11114

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

+17 -4
+7 -3
src/applications/phid/view/PHUIHandleListView.php
··· 38 38 } 39 39 40 40 protected function getTagName() { 41 - // TODO: It would be nice to render this with a proper <ul />, at least in 42 - // block mode, but don't stir the waters up too much for now. 43 - return 'span'; 41 + if ($this->getAsText()) { 42 + return null; 43 + } else { 44 + // TODO: It would be nice to render this with a proper <ul />, at least 45 + // in block mode, but don't stir the waters up too much for now. 46 + return 'span'; 47 + } 44 48 } 45 49 46 50 protected function getTagContent() {
+10 -1
src/view/AphrontTagView.php
··· 92 92 final public function render() { 93 93 $this->willRender(); 94 94 95 + // A tag view may render no tag at all. For example, the HandleListView is 96 + // a container which renders a tag in HTML mode, but can also render in 97 + // text mode without producing a tag. When a tag view has no tag name, just 98 + // return the tag content as though the view did not exist. 99 + $tag_name = $this->getTagName(); 100 + if ($tag_name === null) { 101 + return $this->getTagContent(); 102 + } 103 + 95 104 $attributes = $this->getTagAttributes(); 96 105 97 106 $implode = array('class', 'sigil'); ··· 147 156 } 148 157 149 158 return javelin_tag( 150 - $this->getTagName(), 159 + $tag_name, 151 160 $attributes, 152 161 $this->getTagContent()); 153 162 }