Page MenuHomePhorge

D25231.1735408614.diff
No OneTemporary

D25231.1735408614.diff

diff --git a/src/view/form/control/AphrontFormControl.php b/src/view/form/control/AphrontFormControl.php
--- a/src/view/form/control/AphrontFormControl.php
+++ b/src/view/form/control/AphrontFormControl.php
@@ -56,11 +56,22 @@
return $this->label;
}
+ /**
+ * Set the Caption
+ * The Caption shows a tip usually nearby the related input field.
+ * @param string|PhutilSafeHTML|null
+ * @return self
+ */
public function setCaption($caption) {
$this->caption = $caption;
return $this;
}
+ /**
+ * Get the Caption
+ * The Caption shows a tip usually nearby the related input field.
+ * @return string|PhutilSafeHTML|null
+ */
public function getCaption() {
return $this->caption;
}
@@ -203,7 +214,11 @@
$custom_class .= ' aphront-form-control-nolabel';
}
- if (phutil_nonempty_string($this->getCaption())) {
+ // The Caption can be stuff like PhutilSafeHTML and other objects that
+ // can be casted to a string. After this cast we have never null.
+ $has_caption = phutil_string_cast($this->getCaption()) !== '';
+
+ if ($has_caption) {
$caption = phutil_tag(
'div',
array('class' => 'aphront-form-caption'),

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 28, 17:56 (6 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1036215
Default Alt Text
D25231.1735408614.diff (1 KB)

Event Timeline