1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00

Fix an issue where Harbormaster might cycle while saving

The way custom field interact with storage is a little odd, and can send us
down a bad path when applying external effect while saving changes.
This commit is contained in:
epriestley 2015-10-14 02:56:39 -07:00
parent 43bee4562c
commit 4169d7bfd5
2 changed files with 7 additions and 4 deletions

View file

@ -540,9 +540,7 @@ abstract class PhabricatorCustomField extends Phobject {
* @task storage * @task storage
*/ */
public function newStorageObject() { public function newStorageObject() {
if ($this->proxy) { // NOTE: This intentionally isn't proxied, to avoid call cycles.
return $this->proxy->newStorageObject();
}
throw new PhabricatorCustomFieldImplementationIncompleteException($this); throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} }

View file

@ -186,7 +186,12 @@ abstract class PhabricatorStandardCustomField
} }
public function shouldUseStorage() { public function shouldUseStorage() {
try {
$object = $this->newStorageObject();
return true; return true;
} catch (PhabricatorCustomFieldImplementationIncompleteException $ex) {
return false;
}
} }
public function getValueForStorage() { public function getValueForStorage() {