diff options
| author | fisharebest <fisharebest@gmail.com> | 2013-07-06 06:57:15 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2013-07-06 06:57:15 +0000 |
| commit | 4f5050e795fcd1e3ca96281d6bf894b261e5f399 (patch) | |
| tree | 2722249dce22d084d90364607e60b352fa44dcdf | |
| parent | c65e9092d1636b1db56e0ffd61d39b24a3c797c1 (diff) | |
| download | webtrees-4f5050e795fcd1e3ca96281d6bf894b261e5f399.tar.gz webtrees-4f5050e795fcd1e3ca96281d6bf894b261e5f399.tar.bz2 webtrees-4f5050e795fcd1e3ca96281d6bf894b261e5f399.zip | |
edit-interface - add new spouse
| -rw-r--r-- | edit_interface.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/edit_interface.php b/edit_interface.php index e4de0269ef..014664dae0 100644 --- a/edit_interface.php +++ b/edit_interface.php @@ -2185,17 +2185,22 @@ function print_indi_form($nextaction, WT_Individual $person=null, WT_Family $fam if (!$namerec) { // We'll need the parent's name to set the child's surname $family = WT_Family::getInstance($famid); - $father = $family->getHusband(); - if ($father->getFactByType('NAME')) { - $father_name = $father->getFactByType('NAME')->getValue(); - } else { - $father_name=''; - } - $mother = $family->getWife(); - if ($mother->getFactByType('NAME')) { - $mother_name = $mother->getFactByType('NAME')->getValue(); + if ($family) { + $father = $family->getHusband(); + if ($father->getFactByType('NAME')) { + $father_name = $father->getFactByType('NAME')->getValue(); + } else { + $father_name=''; + } + $mother = $family->getWife(); + if ($mother->getFactByType('NAME')) { + $mother_name = $mother->getFactByType('NAME')->getValue(); + } else { + $mother_name = ''; + } } else { - $mother_name = ''; + $father_name = ''; + $father_name = ''; } // We'll need the spouse/child's name to set the spouse/parent's surname if ($person && $person->getFactByType('NAME')) { |
