@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement DestructibleInterface for Owners Packages

Summary:
Fixes T9945. This is straightforward.

The two sub-object types are very lightweight so I just deleted them directly instead of loading + delete()'ing (or implementing DestructibleInterface on them, which would require they have PHIDs).

Also improve a US English localization.

Test Plan:
- Used `bin/remove destroy PHID-... --trace` to destroy a package.
- Verified it was gone.
- Inspected the SQL in the log for general reasonableness.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9945

Differential Revision: https://secure.phabricator.com/D14729

+34 -1
+1
src/__phutil_library_map__.php
··· 6784 6784 'PhabricatorPolicyInterface', 6785 6785 'PhabricatorApplicationTransactionInterface', 6786 6786 'PhabricatorCustomFieldInterface', 6787 + 'PhabricatorDestructibleInterface', 6787 6788 ), 6788 6789 'PhabricatorOwnersPackageDatasource' => 'PhabricatorTypeaheadDatasource', 6789 6790 'PhabricatorOwnersPackageEditEngine' => 'PhabricatorEditEngine',
+28 -1
src/applications/owners/storage/PhabricatorOwnersPackage.php
··· 5 5 implements 6 6 PhabricatorPolicyInterface, 7 7 PhabricatorApplicationTransactionInterface, 8 - PhabricatorCustomFieldInterface { 8 + PhabricatorCustomFieldInterface, 9 + PhabricatorDestructibleInterface { 9 10 10 11 protected $name; 11 12 protected $originalName; ··· 336 337 public function attachCustomFields(PhabricatorCustomFieldAttachment $fields) { 337 338 $this->customFields = $fields; 338 339 return $this; 340 + } 341 + 342 + 343 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 344 + 345 + 346 + public function destroyObjectPermanently( 347 + PhabricatorDestructionEngine $engine) { 348 + 349 + $this->openTransaction(); 350 + $conn_w = $this->establishConnection('w'); 351 + 352 + queryfx( 353 + $conn_w, 354 + 'DELETE FROM %T WHERE packageID = %d', 355 + id(new PhabricatorOwnersPath())->getTableName(), 356 + $this->getID()); 357 + 358 + queryfx( 359 + $conn_w, 360 + 'DELETE FROM %T WHERE packageID = %d', 361 + id(new PhabricatorOwnersOwner())->getTableName(), 362 + $this->getID()); 363 + 364 + $this->delete(); 365 + $this->saveTransaction(); 339 366 } 340 367 341 368 }
+5
src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
··· 1501 1501 1502 1502 '%s updated %s for %s, added %s: %s; removed %s: %s.' => 1503 1503 '%s updated %s for %s, added: %5$s; removed; %7$s.', 1504 + 1505 + 'Permanently destroyed %s object(s).' => array( 1506 + 'Permanently destroyed %s object.', 1507 + 'Permanently destroyed %s objects.', 1508 + ), 1504 1509 ); 1505 1510 } 1506 1511