Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.4] Incorrect message for user fields #41513

Closed
wants to merge 9 commits into from
Closed
6 changes: 0 additions & 6 deletions administrator/components/com_users/src/Service/HTML/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,6 @@ public function value($value)
if (is_string($value)) {
$value = trim($value);
}

if (empty($value)) {
return Text::_('COM_USERS_PROFILE_VALUE_NOT_FOUND');
} elseif (!is_array($value)) {
return htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/profile/default_custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</dt>
<dd>
<?php if (array_key_exists($field->fieldname, $customFields)) : ?>
<?php echo strlen($customFields[$field->fieldname]->value) ? $customFields[$field->fieldname]->value : Text::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); ?>
<?php echo strlen($customFields[$field->fieldname]->value) ? $customFields[$field->fieldname]->value : ''; ?>
<?php elseif (HTMLHelper::isRegistered('users.' . $field->id)) : ?>
<?php echo HTMLHelper::_('users.' . $field->id, $field->value); ?>
<?php elseif (HTMLHelper::isRegistered('users.' . $field->fieldname)) : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/profile/default_params.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<?php elseif (HTMLHelper::isRegistered('users.' . $field->type)) : ?>
<?php echo HTMLHelper::_('users.' . $field->type, $field->value); ?>
<?php else : ?>
<?php echo HTMLHelper::_('users.value', $field->value); ?>
<?php echo strlen($field->value) ? $field->value : Text::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ trait UserProfileFields
/**
* HTMLHelper method to render the WebAuthn user profile field in the profile view page.
*
* Instead of showing a nonsensical "Website default" label next to the field, this method
* displays the number and names of authenticators already registered by the user.
* This method displays the number and names of authenticators already registered by the user.
*
* This static method is set up for use in the onContentPrepareData method of this plugin.
*
Expand Down