Skip to content

Commit

Permalink
Fix notices in contact view
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hunziker committed Nov 3, 2016
1 parent feed639 commit 188cfeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/com_contact/layouts/field/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$field = $displayData['field'];
$label = $field->label;
$value = $field->value;
$class = $field->render_class;
$class = $field->params->get('render_class');

if (!$value)
{
Expand Down
7 changes: 5 additions & 2 deletions components/com_contact/layouts/fields/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
return;
}

// Check if we have mail context in first element
$isMail = (reset($fields)->context == 'com_contact.mail');

// Load some output definitions
$container = 'dl';

Expand All @@ -64,7 +67,7 @@
$class = $displayData['container-class'];
}

if ($fields[0]->context != 'com_contact.mail')
if (!$isMail)
{
// Print the container tag
echo '<' . $container . ' class="fields-container ' . $class . '">';
Expand All @@ -82,7 +85,7 @@
echo FieldsHelper::render($context, 'field.render', array('field' => $field));
}

if ($fields[0]->context != 'com_contact.mail')
if (!$isMail)
{
// Close the container
echo '</' . $container . '>';
Expand Down

0 comments on commit 188cfeb

Please sign in to comment.