@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 PhabricatorPackagesVersionEditor
4 extends PhabricatorPackagesEditor {
5
6 public function getEditorObjectsDescription() {
7 return pht('Package Versions');
8 }
9
10 public function getCreateObjectTitle($author, $object) {
11 return pht('%s created this version.', $author);
12 }
13
14 public function getCreateObjectTitleForFeed($author, $object) {
15 return pht('%s created %s.', $author, $object);
16 }
17
18 protected function getMailTo(PhabricatorLiskDAO $object) {
19 return array();
20 }
21
22 protected function didCatchDuplicateKeyException(
23 PhabricatorLiskDAO $object,
24 array $xactions,
25 Exception $ex) {
26
27 $errors = array();
28 $errors[] = new PhabricatorApplicationTransactionValidationError(
29 PhabricatorPackagesVersionNameTransaction::TRANSACTIONTYPE,
30 pht('Duplicate'),
31 pht(
32 'The version "%s" already exists for this package. Each version '.
33 'must have a unique name.',
34 $object->getName()),
35 null);
36
37 throw new PhabricatorApplicationTransactionValidationException($errors);
38 }
39
40}