summaryrefslogtreecommitdiff
path: root/library/WT/Controller
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-08-14 18:24:34 +0100
committerGreg Roach <fisharebest@gmail.com>2013-08-14 18:24:34 +0100
commite8e834d0196486623e62b395fbdc6cf6523002f1 (patch)
tree6999fa84264010076f9c2a892599af24a05d73a5 /library/WT/Controller
parent7418500653c2bb91bac44f56e43c9ea908b7597d (diff)
downloadwebtrees-e8e834d0196486623e62b395fbdc6cf6523002f1.tar.gz
webtrees-e8e834d0196486623e62b395fbdc6cf6523002f1.tar.bz2
webtrees-e8e834d0196486623e62b395fbdc6cf6523002f1.zip
Fix error in descendancy chart for one-parent family
Diffstat (limited to 'library/WT/Controller')
-rw-r--r--library/WT/Controller/Descendancy.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/library/WT/Controller/Descendancy.php b/library/WT/Controller/Descendancy.php
index bf9e15bae6..53f8c9ed8e 100644
--- a/library/WT/Controller/Descendancy.php
+++ b/library/WT/Controller/Descendancy.php
@@ -217,12 +217,14 @@ class WT_Controller_Descendancy extends WT_Controller_Chart {
// check if spouse has parents and add an arrow
echo '<td>&nbsp;</td>';
echo '<td>';
- foreach ($spouse->getChildFamilies() as $cfamily) {
- foreach ($cfamily->getSpouses() as $parent) {
- print_url_arrow($parent->getXref().$personcount.$person->getXref(), '?rootid='.$parent->getXref().'&amp;generations='.$this->generations.'&amp;chart_style='.$this->chart_style.'&amp;show_full='.$this->show_full.'&amp;box_width='.$this->box_width.'&amp;ged='.WT_GEDURL, WT_I18N::translate('Start at parents'), 2);
- $personcount++;
- // only show the arrow for one of the parents
- break;
+ if ($spouse) {
+ foreach ($spouse->getChildFamilies() as $cfamily) {
+ foreach ($cfamily->getSpouses() as $parent) {
+ print_url_arrow($parent->getXref().$personcount.$person->getXref(), '?rootid='.$parent->getXref().'&amp;generations='.$this->generations.'&amp;chart_style='.$this->chart_style.'&amp;show_full='.$this->show_full.'&amp;box_width='.$this->box_width.'&amp;ged='.WT_GEDURL, WT_I18N::translate('Start at parents'), 2);
+ $personcount++;
+ // only show the arrow for one of the parents
+ break;
+ }
}
}
if ($this->show_full) echo '<br><br>&nbsp;';