Page MenuHomePhabricator

Miscellanous badge fixes
ClosedPublic

Authored by chad on Feb 24 2017, 11:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 10:30 PM
Unknown Object (File)
Thu, Nov 21, 5:10 PM
Unknown Object (File)
Thu, Nov 21, 11:25 AM
Unknown Object (File)
Sun, Nov 17, 6:46 AM
Unknown Object (File)
Thu, Nov 14, 7:13 AM
Unknown Object (File)
Mon, Nov 11, 6:13 AM
Unknown Object (File)
Sat, Nov 9, 12:58 PM
Unknown Object (File)
Tue, Nov 5, 11:12 AM
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
Branch
misc-badges-clean-up (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15766
Build 20841: Run Core Tests
Build 20840: arc lint + arc unit

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.