Page MenuHomePhorge

Dashboards: Tab panel sometimes displays the content of two tabs
Closed, ResolvedPublic

Description

Example: W32

Seems to be a type juggling issue due to the loose comparison here: https://we.phorge.it/source/phorge/browse/master/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php$289.

	      $content[] = phutil_tag(
	        'div',
	        array(
	          'id' => $content_id,
	          'style' => ($idx == $selected) ? null : 'display: none',
	        ),
	        $panel_content);

In W32 the last tab has an ID of "kq3p37awi2n5" (it seems Phabricator uses an alphanumeric ID after the second tab). In PHP before 8.0 'kq3p37awi2n5' == 0 is true. In PHP 8.0 and above, the comparison does actually work properly because the int gets type casted to string before being compared (https://www.php.net/manual/en/migration80.incompatible.php). The bug isn't always reproduce-able because if the alphanumeric ID begins with an integer, then the comparison actually works properly.

Event Timeline

avivey renamed this task from Tab panel sometimes displays the content of two tabs to Dashboards: Tab panel sometimes displays the content of two tabs.Apr 6 2023, 10:37
avivey edited projects, added Bug Reports; removed Dashboards (archived).
aklapper assigned this task to Dylsss.
aklapper subscribed.

Patch merged thus resolving