Page MenuHomePhabricator

Unhandled Exception when clicking "Award" without choosing a badge; No badge type-ahead proposals if no permission to award badges
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  1. Go to https://phabricator.wikimedia.org/people/badges/12232/
  2. Select "Award Badge"
  3. Input "Volunteer" and submit

Actual Results:

Unhandled Exception ("AphrontParameterQueryException")
Array for %Ls conversion is empty. Query: badges.phid IN (%Ls)

Expected Results:

Badge is awarded

As this has been pointed that it's due to lack of necessary permission T233541#5514334, the expected result should be a nice permission error message

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

WFM, some bad permission checking/error handling?

Screenshot 2019-09-22 at 22.13.30.png (282×1 px, 48 KB)

WFM, some bad permission checking/error handling?

What permissions are needed to award a badge?

WFM, some bad permission checking/error handling?

What permissions are needed to award a badge?

No idea. I have phab admin, it worked. You don't, and it didn't... :)

It's not well documented

Oh well. In the meanwhile @Reedy can you tag me as a volunteer too?

I added a little note at Phabricator/Help#Phabricator_Badges. Only phabricator admins can award badges, and this is intentional if I recall correctly. The restriction is set when the badges are created.

I added a little note at Phabricator/Help#Phabricator_Badges. Only phabricator admins can award badges, and this is intentional if I recall correctly. The restriction is set when the badges are created.

Thanks. So it is indeed poor error handling

Aklapper renamed this task from Error when attempting to award badges to Unhandled Exception error when attempting to award badges and not having sufficient permissions.Sep 23 2019, 5:05 AM
Aklapper renamed this task from Unhandled Exception error when attempting to award badges and not having sufficient permissions to Unhandled Exception error when not entering a badge name and clicking "Award" in that dialog.Sep 23 2019, 6:31 AM

Trying to hand out a badge with my volunteer Phab account, I don't even get a list of badges. I only get back for (;;);{"error":null,"payload":[]} after type-ahead. To be explicit, this error is about leaving the Badge field empty (=not waiting for autocomplete proposals), and then clicking the Award button.

Aklapper triaged this task as Lowest priority.Sep 23 2019, 6:37 AM
Aklapper edited projects, added Phabricator (Upstream); removed Phabricator.

So there are two issues here. I can reproduce both of them in upstream.

  1. Confusing error message

Steps to reproduce:

  1. Go to https://secure.phabricator.com/people/badges/30374/
  2. Click "Award Badge"
  3. Don't enter a name for a badge; directly click "Award" button

Expected outcome:
An informational error message

Actual outcome:

Unhandled Exception ("AphrontParameterQueryException")
Array for %Ls conversion is empty. Query: badges.phid IN (%Ls)
  1. No typeahead proposals and "Browse Badges" (after clicking the magnifier icon) lists no badges, if you don't have permissions to hand out badges.
Aklapper renamed this task from Unhandled Exception error when not entering a badge name and clicking "Award" in that dialog to Unhandled Exception when clicking "Award" without choosing a badge; No badge type-ahead proposals if no permission to award badges.Sep 23 2019, 6:42 AM
Aklapper claimed this task.
Aklapper moved this task from Backlog to Patch released upstream on the Upstream board.

The exception was fixed in upstream rPHAB43d3fd9eac6e (and another one in rPHAB8793bdbaa87c).

As this has been pointed that it's due to lack of necessary permission T233541#5514334, the expected result should be a nice permission error message

In my understanding people have generally permission to award badges but none of the badges allows that. So the current behavior might look confusing but makes sense to me. In any case, that's a different issue about permissions and not about fixing code - please move that to a separate ticket. Thanks!