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

Support "date" custom fields in "*.edit" endpoints

Summary: Fixes T13355. This didn't appear to be a ton of extra work, we just didn't get it for free in the original implementation in D14635.

Test Plan:
- Saw "date" custom fields appear in Conduit API documentation for "maniphest.edit".
- Set custom "date" field to null and non-null values via the API.

{F6666582}

Maniphest Tasks: T13355

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

+20 -9
+16
src/applications/conduit/parametertype/ConduitEpochParameterType.php
··· 3 3 final class ConduitEpochParameterType 4 4 extends ConduitParameterType { 5 5 6 + private $allowNull; 7 + 8 + public function setAllowNull($allow_null) { 9 + $this->allowNull = $allow_null; 10 + return $this; 11 + } 12 + 13 + public function getAllowNull() { 14 + return $this->allowNull; 15 + } 16 + 6 17 protected function getParameterValue(array $request, $key, $strict) { 7 18 $value = parent::getParameterValue($request, $key, $strict); 19 + 20 + if ($this->allowNull && ($value === null)) { 21 + return $value; 22 + } 23 + 8 24 $value = $this->parseIntValue($request, $key, $value, $strict); 9 25 10 26 if ($value <= 0) {
+2 -1
src/applications/transactions/editfield/PhabricatorEpochEditField.php
··· 37 37 } 38 38 39 39 protected function newConduitParameterType() { 40 - return new ConduitEpochParameterType(); 40 + return id(new ConduitEpochParameterType()) 41 + ->setAllowNull($this->getAllowNull()); 41 42 } 42 43 43 44 }
+2 -8
src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
··· 226 226 } 227 227 } 228 228 229 - 230 - public function shouldAppearInConduitTransactions() { 231 - // TODO: Dates are complicated and we don't yet support handling them from 232 - // Conduit. 233 - return false; 234 - } 235 - 236 229 protected function newConduitSearchParameterType() { 237 230 // TODO: Build a new "pair<epoch|null, epoch|null>" type or similar. 238 231 return null; 239 232 } 240 233 241 234 protected function newConduitEditParameterType() { 242 - return new ConduitEpochParameterType(); 235 + return id(new ConduitEpochParameterType()) 236 + ->setAllowNull(!$this->getRequired()); 243 237 } 244 238 245 239 protected function newExportFieldType() {