Skip to content

Commit

Permalink
Add a check if a person has friends.
Browse files Browse the repository at this point in the history
In cases of not having friends an error in template occurred
caused by an unset array after homeAction of Xodx_UserController.
  • Loading branch information
splattater committed Jun 3, 2013
1 parent 375cf14 commit b95db65
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions templates/partials/friendlist.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@
</div>
</form>
<?php endif; ?>
<?php foreach($this->knows as $contact) : ?>
<address>
<?php
if ($contact['name'] != null) {
$name = $contact['name'];
} elseif ($contact['nick'] != null) {
$name = $contact['nick'];
} else {
$name = "unknown name";
}
?>
<strong><?= $name ?></strong><br />
<a href="?c=person&amp;uri=<?= urlencode($contact['contactUri']) ?>"><?= $contact['contactUri'] ?></a>
</address>
<?php endforeach; ?>
<?php if($this->knows !== null) : ?>
<?php foreach($this->knows as $contact) : ?>
<address>
<?php
if ($contact['name'] != null) {
$name = $contact['name'];
} elseif ($contact['nick'] != null) {
$name = $contact['nick'];
} else {
$name = "unknown name";
}
?>
<strong><?= $name ?></strong><br />
<a href="?c=person&amp;uri=<?= urlencode($contact['contactUri']) ?>"><?= $contact['contactUri'] ?></a>
</address>
<?php endforeach; ?>
<?php endif; ?>

This comment has been minimized.

Copy link
@white-gecko

white-gecko Jun 4, 2013

Wenn du die Datei wegen AKSW#32 (comment) eh bearbeitest, könntest du noch eine Leerzeile am Ende anfügen.

0 comments on commit b95db65

Please sign in to comment.