Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editfield/PhabricatorEditField.php
Show All 38 Lines | abstract class PhabricatorEditField extends Phobject { | ||||
private $isSubmittedForm; | private $isSubmittedForm; | ||||
private $controlError; | private $controlError; | ||||
private $canApplyWithoutEditCapability = false; | private $canApplyWithoutEditCapability = false; | ||||
private $isReorderable = true; | private $isReorderable = true; | ||||
private $isDefaultable = true; | private $isDefaultable = true; | ||||
private $isLockable = true; | private $isLockable = true; | ||||
private $isCopyable = false; | private $isCopyable = false; | ||||
private $isConduitOnly = false; | private $isFormField = true; | ||||
private $conduitEditTypes; | private $conduitEditTypes; | ||||
private $bulkEditTypes; | private $bulkEditTypes; | ||||
public function setKey($key) { | public function setKey($key) { | ||||
$this->key = $key; | $this->key = $key; | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | public function setIsReorderable($is_reorderable) { | ||||
$this->isReorderable = $is_reorderable; | $this->isReorderable = $is_reorderable; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIsReorderable() { | public function getIsReorderable() { | ||||
return $this->isReorderable; | return $this->isReorderable; | ||||
} | } | ||||
public function setIsConduitOnly($is_conduit_only) { | public function setIsFormField($is_form_field) { | ||||
$this->isConduitOnly = $is_conduit_only; | $this->isFormField = $is_form_field; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIsConduitOnly() { | public function getIsFormField() { | ||||
return $this->isConduitOnly; | return $this->isFormField; | ||||
} | } | ||||
public function setDescription($description) { | public function setDescription($description) { | ||||
$this->description = $description; | $this->description = $description; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getDescription() { | public function getDescription() { | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | public function getCanApplyWithoutEditCapability() { | ||||
return $this->canApplyWithoutEditCapability; | return $this->canApplyWithoutEditCapability; | ||||
} | } | ||||
protected function newControl() { | protected function newControl() { | ||||
throw new PhutilMethodNotImplementedException(); | throw new PhutilMethodNotImplementedException(); | ||||
} | } | ||||
protected function buildControl() { | protected function buildControl() { | ||||
if ($this->getIsConduitOnly()) { | if (!$this->getIsFormField()) { | ||||
return null; | return null; | ||||
} | } | ||||
$control = $this->newControl(); | $control = $this->newControl(); | ||||
if ($control === null) { | if ($control === null) { | ||||
return null; | return null; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | protected function getDefaultValue() { | ||||
if ($type) { | if ($type) { | ||||
return $type->getDefaultValue(); | return $type->getDefaultValue(); | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
final public function getHTTPParameterType() { | final public function getHTTPParameterType() { | ||||
if ($this->getIsConduitOnly()) { | if (!$this->getIsFormField()) { | ||||
return null; | return null; | ||||
} | } | ||||
$type = $this->newHTTPParameterType(); | $type = $this->newHTTPParameterType(); | ||||
if ($type) { | if ($type) { | ||||
$type->setViewer($this->getViewer()); | $type->setViewer($this->getViewer()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | protected function newCommentAction() { | ||||
return null; | return null; | ||||
} | } | ||||
protected function getValueForCommentAction($value) { | protected function getValueForCommentAction($value) { | ||||
return $value; | return $value; | ||||
} | } | ||||
public function shouldGenerateTransactionsFromSubmit() { | public function shouldGenerateTransactionsFromSubmit() { | ||||
if ($this->getIsConduitOnly()) { | if (!$this->getIsFormField()) { | ||||
return false; | return false; | ||||
} | } | ||||
$edit_type = $this->getEditType(); | $edit_type = $this->getEditType(); | ||||
if (!$edit_type) { | if (!$edit_type) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
public function shouldReadValueFromRequest() { | public function shouldReadValueFromRequest() { | ||||
if ($this->getIsConduitOnly()) { | if (!$this->getIsFormField()) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($this->getIsLocked()) { | if ($this->getIsLocked()) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($this->getIsHidden()) { | if ($this->getIsHidden()) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
public function shouldReadValueFromSubmit() { | public function shouldReadValueFromSubmit() { | ||||
if ($this->getIsConduitOnly()) { | if (!$this->getIsFormField()) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($this->getIsLocked()) { | if ($this->getIsLocked()) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($this->getIsHidden()) { | if ($this->getIsHidden()) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
public function shouldGenerateTransactionsFromComment() { | public function shouldGenerateTransactionsFromComment() { | ||||
if ($this->getIsConduitOnly()) { | if (!$this->getCommentActionLabel()) { | ||||
epriestley: This is the change which exposed the bug identified and fixed in D19845.
I believe the old… | |||||
return false; | return false; | ||||
} | } | ||||
if ($this->getIsLocked()) { | if ($this->getIsLocked()) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($this->getIsHidden()) { | if ($this->getIsHidden()) { | ||||
Show All 24 Lines |
This is the change which exposed the bug identified and fixed in D19845.
I believe the old behavior was not sufficiently strict (it should have checked both this AND "conduit only").