diff options
| author | Greg Roach <fisharebest@gmail.com> | 2013-08-16 09:30:58 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2013-08-16 09:30:58 +0100 |
| commit | 895a1581320ea5ea755959cd9cfad0f1989cfb3e (patch) | |
| tree | 43774844001bf25f168fa310bf5fa0b051f3b9fa /library/WT/Controller | |
| parent | db6998471d25e154311910965c6a11e7867aca10 (diff) | |
| download | webtrees-895a1581320ea5ea755959cd9cfad0f1989cfb3e.tar.gz webtrees-895a1581320ea5ea755959cd9cfad0f1989cfb3e.tar.bz2 webtrees-895a1581320ea5ea755959cd9cfad0f1989cfb3e.zip | |
Fix: one-parent family causes PHP error in hourglass chart
Diffstat (limited to 'library/WT/Controller')
| -rw-r--r-- | library/WT/Controller/Hourglass.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/library/WT/Controller/Hourglass.php b/library/WT/Controller/Hourglass.php index 882c0facb0..777e007b43 100644 --- a/library/WT/Controller/Hourglass.php +++ b/library/WT/Controller/Hourglass.php @@ -299,8 +299,7 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { //-- move the arrow up to line up with the correct box if ($this->show_spouse) { foreach ($families as $family) { - $spouse = $family->getSpouse($person); - echo "<br><br><br>"; + echo '<br><br><br>'; } } echo "</td><td width=\"$bwidth\">"; @@ -352,10 +351,12 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { foreach ($famids as $family) { $spouse = $family->getSpouse($person); - $spid = $spouse->getXref(); - echo "<a href=\"hourglass.php?rootid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\" class=\"name1\">"; - echo $spouse->getFullName(); - echo '</a><br>'; + if ($spouse) { + $spid = $spouse->getXref(); + echo "<a href=\"hourglass.php?rootid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}\" class=\"name1\">"; + echo $spouse->getFullName(); + echo '</a><br>'; + } foreach ($family->getChildren() as $child) { $cid = $child->getXref(); |
