Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15360392
D20690.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D20690.diff
View Options
diff --git a/src/applications/conduit/parametertype/ConduitEpochParameterType.php b/src/applications/conduit/parametertype/ConduitEpochParameterType.php
--- a/src/applications/conduit/parametertype/ConduitEpochParameterType.php
+++ b/src/applications/conduit/parametertype/ConduitEpochParameterType.php
@@ -3,8 +3,24 @@
final class ConduitEpochParameterType
extends ConduitParameterType {
+ private $allowNull;
+
+ public function setAllowNull($allow_null) {
+ $this->allowNull = $allow_null;
+ return $this;
+ }
+
+ public function getAllowNull() {
+ return $this->allowNull;
+ }
+
protected function getParameterValue(array $request, $key, $strict) {
$value = parent::getParameterValue($request, $key, $strict);
+
+ if ($this->allowNull && ($value === null)) {
+ return $value;
+ }
+
$value = $this->parseIntValue($request, $key, $value, $strict);
if ($value <= 0) {
diff --git a/src/applications/transactions/editfield/PhabricatorEpochEditField.php b/src/applications/transactions/editfield/PhabricatorEpochEditField.php
--- a/src/applications/transactions/editfield/PhabricatorEpochEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorEpochEditField.php
@@ -37,7 +37,8 @@
}
protected function newConduitParameterType() {
- return new ConduitEpochParameterType();
+ return id(new ConduitEpochParameterType())
+ ->setAllowNull($this->getAllowNull());
}
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
@@ -226,20 +226,14 @@
}
}
-
- public function shouldAppearInConduitTransactions() {
- // TODO: Dates are complicated and we don't yet support handling them from
- // Conduit.
- return false;
- }
-
protected function newConduitSearchParameterType() {
// TODO: Build a new "pair<epoch|null, epoch|null>" type or similar.
return null;
}
protected function newConduitEditParameterType() {
- return new ConduitEpochParameterType();
+ return id(new ConduitEpochParameterType())
+ ->setAllowNull(!$this->getRequired());
}
protected function newExportFieldType() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 8:25 AM (2 w, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7341340
Default Alt Text
D20690.diff (2 KB)
Attached To
Mode
D20690: Support "date" custom fields in "*.edit" endpoints
Attached
Detach File
Event Timeline
Log In to Comment