Skip to content

Commit

Permalink
Show the value from com_fields instead of the the users helper
Browse files Browse the repository at this point in the history
Closes joomla#81
  • Loading branch information
laoneo committed Apr 26, 2016
1 parent 58feb3f commit c8421df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/com_users/views/profile/tmpl/default_custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
{
unset($fieldsets['params']);
}

$tmp = isset($this->data->fields) ? $this->data->fields : array();
$customFields = array();
foreach ($tmp as $customField)
{
$customFields[$customField->alias] = $customField;
}
?>
<?php foreach ($fieldsets as $group => $fieldset) : ?>
<?php $fields = $this->form->getFieldset($group); ?>
Expand All @@ -36,7 +43,9 @@
<?php if (!$field->hidden && $field->type !== 'Spacer') : ?>
<dt><?php echo $field->title; ?></dt>
<dd>
<?php if (JHtml::isRegistered('users.' . $field->id)) : ?>
<?php if (key_exists($field->fieldname, $customFields)) : ?>
<?php echo $customFields[$field->fieldname]->value; ?>
<?php elseif (JHtml::isRegistered('users.' . $field->id)) : ?>
<?php echo JHtml::_('users.' . $field->id, $field->value); ?>
<?php elseif (JHtml::isRegistered('users.' . $field->fieldname)) : ?>
<?php echo JHtml::_('users.' . $field->fieldname, $field->value); ?>
Expand Down
5 changes: 5 additions & 0 deletions components/com_users/views/profile/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public function display($tpl = null)
$this->data->tags = new JHelperTags;
$this->data->tags->getItemTags('com_users.user.', $this->data->id);

JPluginHelper::importPlugin('content');
$this->data->text = '';
JEventDispatcher::getInstance()->trigger('onContentPrepare', array ('com_users.user', &$this->data, &$this->data->params, 0));
unset($this->data->text);

// Check for layout override
$active = JFactory::getApplication()->getMenu()->getActive();

Expand Down

0 comments on commit c8421df

Please sign in to comment.