@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.

Make Maniphest custom fields extend PhabricatorCustomField

Summary:
Ref T418. These implementations share no method names, so we can safely just move Maniphest fields into the `PhabricatorCustomField` hierarchy.

Replaces two Maniphest-specific custom field exceptions which nothing catches.

Test Plan: Viewed Maniphest, edited/altered custom fields.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T418

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

+18 -25
+7 -5
src/__phutil_library_map__.php
··· 686 686 'ManiphestAction' => 'applications/maniphest/constants/ManiphestAction.php', 687 687 'ManiphestAuxiliaryFieldDefaultSpecification' => 'applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldDefaultSpecification.php', 688 688 'ManiphestAuxiliaryFieldSpecification' => 'applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldSpecification.php', 689 - 'ManiphestAuxiliaryFieldTypeException' => 'applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldTypeException.php', 690 - 'ManiphestAuxiliaryFieldValidationException' => 'applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldValidationException.php', 691 689 'ManiphestBatchEditController' => 'applications/maniphest/controller/ManiphestBatchEditController.php', 692 690 'ManiphestConstants' => 'applications/maniphest/constants/ManiphestConstants.php', 693 691 'ManiphestController' => 'applications/maniphest/controller/ManiphestController.php', 694 692 'ManiphestCreateMailReceiver' => 'applications/maniphest/mail/ManiphestCreateMailReceiver.php', 693 + 'ManiphestCustomField' => 'applications/maniphest/field/ManiphestCustomField.php', 695 694 'ManiphestDAO' => 'applications/maniphest/storage/ManiphestDAO.php', 696 695 'ManiphestDefaultTaskExtensions' => 'applications/maniphest/extensions/ManiphestDefaultTaskExtensions.php', 697 696 'ManiphestEdgeEventListener' => 'applications/maniphest/event/ManiphestEdgeEventListener.php', ··· 2746 2745 'LiskRawMigrationIterator' => 'PhutilBufferedIterator', 2747 2746 'ManiphestAction' => 'ManiphestConstants', 2748 2747 'ManiphestAuxiliaryFieldDefaultSpecification' => 'ManiphestAuxiliaryFieldSpecification', 2749 - 'ManiphestAuxiliaryFieldSpecification' => 'PhabricatorMarkupInterface', 2750 - 'ManiphestAuxiliaryFieldTypeException' => 'Exception', 2751 - 'ManiphestAuxiliaryFieldValidationException' => 'Exception', 2748 + 'ManiphestAuxiliaryFieldSpecification' => 2749 + array( 2750 + 0 => 'ManiphestCustomField', 2751 + 1 => 'PhabricatorMarkupInterface', 2752 + ), 2752 2753 'ManiphestBatchEditController' => 'ManiphestController', 2753 2754 'ManiphestController' => 'PhabricatorController', 2754 2755 'ManiphestCreateMailReceiver' => 'PhabricatorMailReceiver', 2756 + 'ManiphestCustomField' => 'PhabricatorCustomField', 2755 2757 'ManiphestDAO' => 'PhabricatorLiskDAO', 2756 2758 'ManiphestDefaultTaskExtensions' => 'ManiphestTaskExtensions', 2757 2759 'ManiphestEdgeEventListener' => 'PhutilEventListener',
+4 -4
src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldDefaultSpecification.php
··· 121 121 break; 122 122 default: 123 123 $label = $this->getLabel(); 124 - throw new ManiphestAuxiliaryFieldTypeException( 124 + throw new Exception( 125 125 "Field type '{$type}' is not a valid type (for field '{$label}')."); 126 126 break; 127 127 } ··· 248 248 switch ($this->getFieldType()) { 249 249 case self::TYPE_INT: 250 250 if ($this->getValue() && !is_numeric($this->getValue())) { 251 - throw new ManiphestAuxiliaryFieldValidationException( 251 + throw new PhabricatorCustomFieldValidationException( 252 252 pht( 253 253 '%s must be an integer value.', 254 254 $this->getLabel())); ··· 262 262 return true; 263 263 case self::TYPE_DATE: 264 264 if ((int)$this->getValue() <= 0 && $this->isRequired()) { 265 - throw new ManiphestAuxiliaryFieldValidationException( 265 + throw new PhabricatorCustomFieldValidationException( 266 266 pht( 267 267 '%s must be a valid date.', 268 268 $this->getLabel())); ··· 271 271 case self::TYPE_USER: 272 272 case self::TYPE_USERS: 273 273 if (!is_array($this->getValue())) { 274 - throw new ManiphestAuxiliaryFieldValidationException( 274 + throw new PhabricatorCustomFieldValidationException( 275 275 pht( 276 276 '%s is not a valid list of user PHIDs.', 277 277 $this->getLabel()));
+1
src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldSpecification.php
··· 4 4 * @group maniphest 5 5 */ 6 6 abstract class ManiphestAuxiliaryFieldSpecification 7 + extends ManiphestCustomField 7 8 implements PhabricatorMarkupInterface { 8 9 9 10 const RENDER_TARGET_HTML = 'html';
-8
src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldTypeException.php
··· 1 - <?php 2 - 3 - /** 4 - * @group maniphest 5 - */ 6 - final class ManiphestAuxiliaryFieldTypeException extends Exception { 7 - 8 - }
-8
src/applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldValidationException.php
··· 1 - <?php 2 - 3 - /** 4 - * @group maniphest 5 - */ 6 - final class ManiphestAuxiliaryFieldValidationException extends Exception { 7 - 8 - }
+6
src/applications/maniphest/field/ManiphestCustomField.php
··· 1 + <?php 2 + 3 + abstract class ManiphestCustomField 4 + extends PhabricatorCustomField { 5 + 6 + }