1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Fix tag limit logic in PHUIHandleTagListView

Summary: Fixes T10648. This was goofed and always did a meaningless no-op slice -- I mucked it up while doing the disabled project stuff elsewhere.

Test Plan:
  - Tagged something with 5 projects.
  - Saw the list sliced to 4 (the limit) with "...".

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10648

Differential Revision: https://secure.phabricator.com/D15508
This commit is contained in:
epriestley 2016-03-22 09:20:32 -07:00
parent 5a604538ca
commit 86720b4595

View file

@ -61,7 +61,7 @@ final class PHUIHandleTagListView extends AphrontTagView {
} }
} }
if ($this->limit && ($this->limit > count($handles))) { if ($this->limit && (count($handles) > $this->limit)) {
if (!is_array($handles)) { if (!is_array($handles)) {
$handles = iterator_to_array($handles); $handles = iterator_to_array($handles);
} }
@ -85,7 +85,7 @@ final class PHUIHandleTagListView extends AphrontTagView {
} }
if ($this->limit) { if ($this->limit) {
if ($this->limit < count($this->handles)) { if (count($this->handles) > $this->limit) {
$tip_text = implode(', ', mpull($this->handles, 'getName')); $tip_text = implode(', ', mpull($this->handles, 'getName'));
$more = $this->newPlaceholderTag() $more = $this->newPlaceholderTag()