Page MenuHomePhorge

Ignore bogus cards parameter string values in Hovercards calls
AcceptedPublic

Authored by aklapper on Sun, May 18, 20:35.

Details

Summary

Do not throw an exception when passing bogus parameter string values to hovercards. Instead, just convert to an empty array.
In consequence, see a proper hovercard correctly displaying Unknown Object (????) instead of an exception:

EXCEPTION: (TypeError) idx(): Argument #1 ($array) must be of type array, string given, called in /var/www/html/phorge/phorge/src/applications/search/controller/PhabricatorSearchHovercardController.php on line 37 at [<arcanist>/src/utils/utils.php:37]

See also similar rPa5384ca60470e56a5312d5a7147ddd3ffa2e75d8.

Closes T16075

Test Plan

Diff Detail

Repository
rP Phorge
Branch
hovercardsIdxArray (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1987
Build 1987: arc lint + arc unit

Event Timeline

src/applications/search/controller/PhabricatorSearchHovercardController.php
104

is_array() 👍

(alsorecommended by the manual of gettype)

also above

Sigh, I swear I grep'ed for isArray before but I was in a parallel CamelCase world in that moment

sgtm

src/applications/search/controller/PhabricatorSearchHovercardController.php
13

Wow. We have our own JSON parser.

Related task:

T16076: Understand if we still need our own JSON parser

This revision is now accepted and ready to land.Mon, May 19, 07:00