Page MenuHomePhabricator

Update Phurl for modular transactions
ClosedPublic

Authored by chad on Feb 24 2017, 4:25 AM.
Tags
None
Referenced Files
F14074486: D17405.id41858.diff
Thu, Nov 21, 7:16 AM
Unknown Object (File)
Sat, Nov 16, 11:54 PM
Unknown Object (File)
Sat, Nov 9, 12:56 PM
Unknown Object (File)
Oct 21 2024, 3:13 AM
Unknown Object (File)
Oct 18 2024, 10:53 PM
Unknown Object (File)
Oct 18 2024, 9:48 PM
Unknown Object (File)
Oct 18 2024, 9:15 PM
Unknown Object (File)
Oct 18 2024, 9:11 PM
Subscribers
Tokens
"Orange Medal" token, awarded by epriestley.

Details

Summary

Ref T6049. This moves Phurl to modular transactions.

Test Plan

Everything works here, add phurl, edit phurl, use phurl. Test various error states. Left a TODO on the validate dupe keys, not sure how to implement that in modular-land.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
2327

grep seems to indicate only place used was phurl. ok to move?

validateIsTextFieldTooLong() is good to nuke, but just follow the pattern in DifferentialRevisionTitleTransaction inline instead of moving it. In particular:

  • Use getColumnMaximumByteLength() rather than hard-coding a length, so if we change the column later the code will automatically use the correct value.
  • strlen(), not phutil_utf8_strlen(), is the best method to use in this case because getColumnMaximumByteLength() is now a strict byte limit.
  • No need to check the old value.
src/applications/phurl/editor/PhabricatorPhurlURLEditor.php
251–264

This just stays the same in ModularTransactions, at least for now. There's no real way for us to tell which transaction might be able to handle it. We could maybe just ask each type if it knows what's going on, but I think it will be rare/impossible for third-party code to ever cause duplicate key exceptions to occur that it can't handle directly.

This revision is now accepted and ready to land.Feb 24 2017, 12:14 PM
src/applications/phurl/editor/PhabricatorPhurlURLEditor.php
251–264

Stays the same?

Just change the PhabricatorPhurlURLTransaction::TYPE_ALIAS constant but leave it where it is otherwise without other changes.

That is, leave it intact in PhabricatorPhurlURLEditor.

This revision was automatically updated to reflect the committed changes.