Page MenuHomePhabricator

Update Phurl for modular transactions
ClosedPublic

Authored by chad on Feb 24 2017, 4:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 7:26 PM
Unknown Object (File)
Wed, Dec 18, 2:19 PM
Unknown Object (File)
Wed, Dec 18, 12:37 PM
Unknown Object (File)
Wed, Dec 18, 12:37 PM
Unknown Object (File)
Wed, Dec 18, 12:37 PM
Unknown Object (File)
Wed, Dec 18, 12:37 PM
Unknown Object (File)
Wed, Dec 18, 2:53 AM
Unknown Object (File)
Wed, Dec 18, 2:31 AM
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.