summaryrefslogtreecommitdiff
path: root/library/WT/Controller
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-08-16 09:30:58 +0100
committerGreg Roach <fisharebest@gmail.com>2013-08-16 09:30:58 +0100
commit895a1581320ea5ea755959cd9cfad0f1989cfb3e (patch)
tree43774844001bf25f168fa310bf5fa0b051f3b9fa /library/WT/Controller
parentdb6998471d25e154311910965c6a11e7867aca10 (diff)
downloadwebtrees-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.php13
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}&amp;show_spouse={$this->show_spouse}&amp;show_full={$this->show_full}&amp;generations={$this->generations}&amp;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}&amp;show_spouse={$this->show_spouse}&amp;show_full={$this->show_full}&amp;generations={$this->generations}&amp;box_width={$this->box_width}\" class=\"name1\">";
+ echo $spouse->getFullName();
+ echo '</a><br>';
+ }
foreach ($family->getChildren() as $child) {
$cid = $child->getXref();