Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14756495
D21854.id52087.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D21854.id52087.diff
View Options
diff --git a/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php b/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php
--- a/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorRemarkupEditField.php
@@ -29,6 +29,32 @@
return $value;
}
+ public function getValueForDefaults() {
+ $value = parent::getValueForDefaults();
+
+ if ($value instanceof RemarkupValue) {
+ $value = $value->getCorpus();
+ }
+
+ return $value;
+ }
+
+ protected function getDefaultValueFromConfiguration($value) {
+
+ // See T13685. After changes to file attachment handling, the database
+ // was briefly poisoned with "array()" values as defaults.
+
+ try {
+ $value = phutil_string_cast($value);
+ } catch (Exception $ex) {
+ $value = '';
+ } catch (Throwable $ex) {
+ $value = '';
+ }
+
+ return $value;
+ }
+
public function getMetadata() {
$defaults = array();
diff --git a/src/view/form/control/AphrontFormTextAreaControl.php b/src/view/form/control/AphrontFormTextAreaControl.php
--- a/src/view/form/control/AphrontFormTextAreaControl.php
+++ b/src/view/form/control/AphrontFormTextAreaControl.php
@@ -73,7 +73,7 @@
// NOTE: This needs to be string cast, because if we pass `null` the
// tag will be self-closed and some browsers aren't thrilled about that.
- $value = (string)$this->getValue();
+ $value = phutil_string_cast($this->getValue());
// NOTE: We also need to prefix the string with a newline, because browsers
// ignore a newline immediately after a <textarea> tag, so they'll eat
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 7:52 PM (4 h, 49 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7033661
Default Alt Text
D21854.id52087.diff (1 KB)
Attached To
Mode
D21854: Flatten "RemarkupValue" objects when setting field defaults for custom forms
Attached
Detach File
Event Timeline
Log In to Comment