Page MenuHomePhabricator

Update Phurl for modular transactions
ClosedPublic

Authored by chad on Feb 24 2017, 4:25 AM.
Tags
None
Referenced Files
F12594028: D17405.id.diff
Mon, Mar 18, 2:59 PM
Unknown Object (File)
Feb 10 2024, 6:25 AM
Unknown Object (File)
Feb 3 2024, 2:44 PM
Unknown Object (File)
Feb 3 2024, 1:57 PM
Unknown Object (File)
Jan 27 2024, 8:48 PM
Unknown Object (File)
Dec 29 2023, 6:39 AM
Unknown Object (File)
Dec 27 2023, 9:57 AM
Unknown Object (File)
Dec 27 2023, 9:57 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.