Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15419898
D8725.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D8725.diff
View Options
diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php
--- a/src/applications/config/controller/PhabricatorConfigEditController.php
+++ b/src/applications/config/controller/PhabricatorConfigEditController.php
@@ -94,7 +94,14 @@
}
}
} else {
- $display_value = $this->getDisplayValue($option, $config_entry);
+ if ($config_entry->getIsDeleted()) {
+ $display_value = null;
+ } else {
+ $display_value = $this->getDisplayValue(
+ $option,
+ $config_entry,
+ $config_entry->getValue());
+ }
}
$form = new AphrontFormView();
@@ -186,7 +193,7 @@
$form->appendChild(
id(new AphrontFormMarkupControl())
->setLabel(pht('Default'))
- ->setValue($this->renderDefaults($option)));
+ ->setValue($this->renderDefaults($option, $config_entry)));
}
$title = pht('Edit %s', $this->key);
@@ -348,17 +355,16 @@
private function getDisplayValue(
PhabricatorConfigOption $option,
- PhabricatorConfigEntry $entry) {
-
- if ($entry->getIsDeleted()) {
- return null;
- }
+ PhabricatorConfigEntry $entry,
+ $value) {
if ($option->isCustomType()) {
- return $option->getCustomObject()->getDisplayValue($option, $entry);
+ return $option->getCustomObject()->getDisplayValue(
+ $option,
+ $entry,
+ $value);
} else {
$type = $option->getType();
- $value = $entry->getValue();
switch ($type) {
case 'int':
case 'string':
@@ -497,7 +503,10 @@
$table);
}
- private function renderDefaults(PhabricatorConfigOption $option) {
+ private function renderDefaults(
+ PhabricatorConfigOption $option,
+ PhabricatorConfigEntry $entry) {
+
$stack = PhabricatorEnv::getConfigSourceStack();
$stack = $stack->getStack();
@@ -515,7 +524,9 @@
if (!array_key_exists($option->getKey(), $value)) {
$value = phutil_tag('em', array(), pht('(empty)'));
} else {
- $value = PhabricatorConfigJSON::prettyPrintJSON(
+ $value = $this->getDisplayValue(
+ $option,
+ $entry,
$value[$option->getKey()]);
}
diff --git a/src/applications/config/custom/PhabricatorConfigJSONOptionType.php b/src/applications/config/custom/PhabricatorConfigJSONOptionType.php
--- a/src/applications/config/custom/PhabricatorConfigJSONOptionType.php
+++ b/src/applications/config/custom/PhabricatorConfigJSONOptionType.php
@@ -34,18 +34,6 @@
return array($e_value, $errors, $storage_value, $display_value);
}
- public function getDisplayValue(
- PhabricatorConfigOption $option,
- PhabricatorConfigEntry $entry) {
- $value = $entry->getValue();
- if (!$value) {
- return '';
- }
-
- $json = new PhutilJSON();
- return $json->encodeFormatted($value);
- }
-
public function renderControl(
PhabricatorConfigOption $option,
$display_value,
diff --git a/src/applications/config/custom/PhabricatorConfigOptionType.php b/src/applications/config/custom/PhabricatorConfigOptionType.php
--- a/src/applications/config/custom/PhabricatorConfigOptionType.php
+++ b/src/applications/config/custom/PhabricatorConfigOptionType.php
@@ -20,8 +20,16 @@
public function getDisplayValue(
PhabricatorConfigOption $option,
- PhabricatorConfigEntry $entry) {
- return $entry->getValue();
+ PhabricatorConfigEntry $entry,
+ $value) {
+
+ if (is_array($value)) {
+ $json = new PhutilJSON();
+ return $json->encodeFormatted($value);
+ } else {
+ return $value;
+ }
+
}
public function renderControl(
diff --git a/src/applications/config/option/PhabricatorCoreConfigOptions.php b/src/applications/config/option/PhabricatorCoreConfigOptions.php
--- a/src/applications/config/option/PhabricatorCoreConfigOptions.php
+++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php
@@ -59,8 +59,8 @@
"won't work. The major use case for this is moving installs ".
"across domains."))
->addExample(
- '["http://phabricator2.example.com/", '.
- '"http://phabricator3.example.com/"]',
+ "http://phabricator2.example.com/\n".
+ "http://phabricator3.example.com/",
pht('Valid Setting')),
$this->newOption('phabricator.timezone', 'string', null)
->setSummary(
diff --git a/src/applications/config/option/PhabricatorSecurityConfigOptions.php b/src/applications/config/option/PhabricatorSecurityConfigOptions.php
--- a/src/applications/config/option/PhabricatorSecurityConfigOptions.php
+++ b/src/applications/config/option/PhabricatorSecurityConfigOptions.php
@@ -124,8 +124,7 @@
"automatically linked if the protocol appears in this set. This ".
"whitelist is primarily to prevent security issues like ".
"javascript:// URIs."))
- ->addExample(
- '{"http": true, "https": true"}', pht('Valid Setting'))
+ ->addExample("http\nhttps", pht('Valid Setting'))
->setLocked(true),
$this->newOption(
'uri.allowed-editor-protocols',
diff --git a/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php b/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php
--- a/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php
+++ b/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php
@@ -196,7 +196,7 @@
*
* @param string Resource name.
* @param string Resource data.
- * @return pair<string|null, list<string>|nul> The `@provides` symbol and the
+ * @return pair<string|null, list<string>|null> The `@provides` symbol and the
* list of `@requires` symbols. If the resource is not part of the
* dependency graph, both are null.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 22 2025, 9:47 AM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704411
Default Alt Text
D8725.diff (5 KB)
Attached To
Mode
D8725: Render default/current settings in the same format they'll be edited
Attached
Detach File
Event Timeline
Log In to Comment