Page MenuHomePhabricator

Miscellanous badge fixes
ClosedPublic

Authored by chad on Feb 24 2017, 11:00 PM.
Tags
None
Attached Files
Unknown Object (File)
Apr 16 2017, 4:13 PM
Unknown Object (File)
Apr 16 2017, 11:40 AM
Unknown Object (File)
Apr 14 2017, 10:33 AM
Unknown Object (File)
Apr 12 2017, 1:12 AM
Unknown Object (File)
Apr 6 2017, 10:38 PM
Unknown Object (File)
Apr 6 2017, 9:15 AM
Unknown Object (File)
Mar 12 2017, 2:44 AM
Unknown Object (File)
Feb 26 2017, 6:41 PM
Subscribers
Tokens
"Manufacturing Defect?" token, awarded by epriestley.

Details

Summary

Ref T12270. Add transaction validation for name, alias, award, revoke. Change auto subscribe for authors. Fix some typos.

Test Plan

Add badge, award badge, revoke badge, edit badge.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.php
66

haha ha haaa

I think there's a bug? Does awarding to two users at the same time work?

src/applications/badges/xaction/PhabricatorBadgesBadgeAwardTransaction.php
65

Does this actually work? Isn't getNewValue() a list of recipients?

66

ya this looks a whole lot like copy-pasta buddy

src/applications/badges/xaction/PhabricatorBadgesBadgeFlavorTransaction.php
41–44

Prefer %s + new PhutilNumber() so we can extract a translation hint and render large numbers in a fancy readable way like "1,234" instead of "1234".

src/applications/badges/xaction/PhabricatorBadgesBadgeRevokeTransaction.php
55–77

Instead, maybe just validate that the recipient is currently awarded, but ignore their PHID type? That's a little more future-proof, and I think we'll currently crash if you un-award a badge to a user who doesn't have it.

This revision now requires changes to proceed.Feb 24 2017, 11:06 PM

I might have not tested that.

chad edited edge metadata.
  • run test plan proper like
This revision is now accepted and ready to land.Feb 24 2017, 11:46 PM
This revision was automatically updated to reflect the committed changes.