Homestyx hydra
Diffusion hydra 43d3fd9eac6e

Fix exception awarding empty badge to user

Description

Fix exception awarding empty badge to user

Summary:
When awarding a badge to a user without having actually selected a batch to award, do not fail on running a database query with no parameter. Instead, silently fail without an error and reload the page, similar to the behavior of Add Recipients on /badges/recipients/1/ in this case.
Do not throw an Aphront404Response as it would make the Award Badge button in the dialog inaccessible and keep the dysfunctional overlay dialog displayed.

EXCEPTION: (AphrontParameterQueryException) Array for %Ls conversion is empty. Query: badges.phid IN (%Ls) at [<phorge>/src/infrastructure/storage/xsprintf/qsprintf.php:383]

Closes T15825

Test Plan: Go to a user's badges, click the Award Badge button, in the dialog do not select any Badge and click the Award button.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15825

Differential Revision: https://we.phorge.it/D25636

Details

Provenance
Andre KlapperAuthored on May 12 2024, 4:15 AM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:899abf7a2b53: Redirect back to object after clicking "Log In to Comment" and login
Branches
Unknown
Tags
Unknown

Event Timeline