@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<?php
2
3final class PhabricatorPackagesPublisherEditor
4 extends PhabricatorPackagesEditor {
5
6 public function getEditorObjectsDescription() {
7 return pht('Package Publishers');
8 }
9
10 public function getCreateObjectTitle($author, $object) {
11 return pht('%s created this publisher.', $author);
12 }
13
14 public function getCreateObjectTitleForFeed($author, $object) {
15 return pht('%s created %s.', $author, $object);
16 }
17
18 public function getTransactionTypes() {
19 $types = parent::getTransactionTypes();
20 $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
21 return $types;
22 }
23
24 protected function getMailTo(PhabricatorLiskDAO $object) {
25 return array();
26 }
27
28 protected function didCatchDuplicateKeyException(
29 PhabricatorLiskDAO $object,
30 array $xactions,
31 Exception $ex) {
32
33 $errors = array();
34 $errors[] = new PhabricatorApplicationTransactionValidationError(
35 PhabricatorPackagesPublisherKeyTransaction::TRANSACTIONTYPE,
36 pht('Duplicate'),
37 pht(
38 'The publisher key "%s" is already in use by another publisher.',
39 $object->getPublisherKey()),
40 null);
41
42 throw new PhabricatorApplicationTransactionValidationException($errors);
43 }
44
45}