diff --git a/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php b/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php index fd973c0da7..568b7bc399 100644 --- a/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php +++ b/src/applications/policy/editor/PhabricatorPolicyEditEngineExtension.php @@ -101,6 +101,9 @@ final class PhabricatorPolicyEditEngineExtension if ($capability == PhabricatorPolicyCapability::CAN_VIEW) { $type_space = PhabricatorTransactions::TYPE_SPACE; if (isset($types[$type_space])) { + $space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID( + $object); + $space_field = id(new PhabricatorSpaceEditField()) ->setKey('spacePHID') ->setLabel(pht('Space')) @@ -114,7 +117,7 @@ final class PhabricatorPolicyEditEngineExtension ->setConduitDescription( pht('Shift the object between spaces.')) ->setConduitTypeDescription(pht('New space PHID.')) - ->setValue($object->getSpacePHID()); + ->setValue($space_phid); $fields[] = $space_field; $space_field->setPolicyField($policy_field); diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php index 6fa6a6458e..7d50f8495c 100644 --- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php @@ -527,6 +527,11 @@ abstract class PhabricatorApplicationTransaction // TODO: Remove this eventually, this is handling old changes during // object creation prior to the introduction of "create" and "default" // transaction display flags. + + // NOTE: We can also hit this case with Space transactions that later + // update a default space (`null`) to an explicit space, so handling + // the Space case may require some finesse. + if ($this->getOldValue() === null) { return true; } else {