Skip to content
Snippets Groups Projects
Commit a10cd273 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Avoid empty fields to be displayed.  Patch by Moshe.
parent d2d381d7
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -44,9 +44,15 @@ function comment_conf_options() {
function comment_user($type, $edit, &$user) {
switch ($type) {
case "view_public":
return form_item(t("Signature"), check_output($user->signature, 1));
if ($user->signature) {
return form_item(t("Signature"), check_output($user->signature, 1));
}
break;
case "view_private":
return form_item(t("Signature"), check_output($user->signature, 1));
if ($user->signature) {
return form_item(t("Signature"), check_output($user->signature, 1));
}
break;
case "edit_form":
// when user tries to edit his own data
return form_textarea(t("Signature"), "signature", $edit["signature"], 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."<br />". t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", "<a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul>")));
......
......@@ -44,9 +44,15 @@ function comment_conf_options() {
function comment_user($type, $edit, &$user) {
switch ($type) {
case "view_public":
return form_item(t("Signature"), check_output($user->signature, 1));
if ($user->signature) {
return form_item(t("Signature"), check_output($user->signature, 1));
}
break;
case "view_private":
return form_item(t("Signature"), check_output($user->signature, 1));
if ($user->signature) {
return form_item(t("Signature"), check_output($user->signature, 1));
}
break;
case "edit_form":
// when user tries to edit his own data
return form_textarea(t("Signature"), "signature", $edit["signature"], 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."<br />". t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", "<a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul>")));
......
......@@ -168,7 +168,9 @@ function jabber_user($type, $edit, $user) {
switch ($type) {
case "view_private":
$result = user_get_authname($user, $module);
$output .= form_item(t("$name ID"), $result);
if ($result) {
$output .= form_item(t("$name ID"), $result);
}
return $output;
case "edit_form":
$result = user_get_authname($user, $module);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment