1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

In ApplicationTransactionEditor, determine new objects with "getID()" instead of "getPHID()"

Summary:
See <https://discourse.phabricator-community.org/t/unable-to-reload-object-that-hasnt-been-loaded/2677>.

When editing "Config" objects, they currently get a PHID set outside of the TransactionEditor. They probably should not, but fixing that is likely an involved change.

This causes us to incorrectly fail to detect `$is_new` correctly and try to `reload()` and object with no ID.

To work around this, test for new objects with `getID()` instead of `getPHID()`.

Test Plan: Edited any config value with the web UI.

Reviewers: amckinley

Differential Revision: https://secure.phabricator.com/D20482
This commit is contained in:
epriestley 2019-04-29 07:33:53 -07:00
parent c0a4d1de13
commit 0d9362355b

View file

@ -977,7 +977,7 @@ abstract class PhabricatorApplicationTransactionEditor
PhabricatorLiskDAO $object,
array $xactions) {
$is_new = ($object->getPHID() === null);
$is_new = ($object->getID() === null);
$this->isNewObject = $is_new;
$is_preview = $this->getIsPreview();