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

Remove "AlmanacPropertyInterface" from "AlmanacNamespace"

Summary:
See <https://discourse.phabricator-community.org/t/i-cant-create-almanac-space/4424/>.

Almanac namespaces have never really had property support, but they implemented the interface in the original implementation.

At the time, this had no effect. Later changes integrated properties into the edit flows and broke this no-op integration.

Remove the interface for now. They could be given property support later, but need a bit of support code.

This feature is very rarely used and primarily useful for Phacility instances.

Test Plan: Created new namespaces and edited namespaces, browsed namespace UI.

Differential Revision: https://secure.phabricator.com/D21543
This commit is contained in:
epriestley 2021-02-03 15:00:54 -08:00
parent 9502312b60
commit a7bd58c4bb
2 changed files with 1 additions and 53 deletions

View file

@ -6115,7 +6115,6 @@ phutil_register_library_map(array(
'PhabricatorPolicyInterface',
'PhabricatorApplicationTransactionInterface',
'PhabricatorProjectInterface',
'AlmanacPropertyInterface',
'PhabricatorDestructibleInterface',
'PhabricatorNgramsInterface',
'PhabricatorConduitResultInterface',

View file

@ -6,7 +6,6 @@ final class AlmanacNamespace
PhabricatorPolicyInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorProjectInterface,
AlmanacPropertyInterface,
PhabricatorDestructibleInterface,
PhabricatorNgramsInterface,
PhabricatorConduitResultInterface {
@ -17,13 +16,10 @@ final class AlmanacNamespace
protected $viewPolicy;
protected $editPolicy;
private $almanacProperties = self::ATTACHABLE;
public static function initializeNewNamespace() {
return id(new self())
->setViewPolicy(PhabricatorPolicies::POLICY_USER)
->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN)
->attachAlmanacProperties(array());
->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN);
}
protected function getConfiguration() {
@ -113,53 +109,6 @@ final class AlmanacNamespace
}
/* -( AlmanacPropertyInterface )------------------------------------------- */
public function attachAlmanacProperties(array $properties) {
assert_instances_of($properties, 'AlmanacProperty');
$this->almanacProperties = mpull($properties, null, 'getFieldName');
return $this;
}
public function getAlmanacProperties() {
return $this->assertAttached($this->almanacProperties);
}
public function hasAlmanacProperty($key) {
$this->assertAttached($this->almanacProperties);
return isset($this->almanacProperties[$key]);
}
public function getAlmanacProperty($key) {
return $this->assertAttachedKey($this->almanacProperties, $key);
}
public function getAlmanacPropertyValue($key, $default = null) {
if ($this->hasAlmanacProperty($key)) {
return $this->getAlmanacProperty($key)->getFieldValue();
} else {
return $default;
}
}
public function getAlmanacPropertyFieldSpecifications() {
return array();
}
public function newAlmanacPropertyEditEngine() {
throw new PhutilMethodNotImplementedException();
}
public function getAlmanacPropertySetTransactionType() {
throw new PhutilMethodNotImplementedException();
}
public function getAlmanacPropertyDeleteTransactionType() {
throw new PhutilMethodNotImplementedException();
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */