diff options
| author | Greg Roach <fisharebest@gmail.com> | 2013-10-31 20:29:17 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2013-10-31 20:29:17 +0000 |
| commit | b29bae5ebd4cf53e741bb05e583a0fc7c7b462dc (patch) | |
| tree | 45050ec80e8513a85f31fab86e593dde4dc11650 /library/WT/Controller | |
| parent | 2ee41b059cc5ab0d8e355f8302f6fa457bc683c3 (diff) | |
| download | webtrees-b29bae5ebd4cf53e741bb05e583a0fc7c7b462dc.tar.gz webtrees-b29bae5ebd4cf53e741bb05e583a0fc7c7b462dc.tar.bz2 webtrees-b29bae5ebd4cf53e741bb05e583a0fc7c7b462dc.zip | |
#1246866 - Branches Phonetic search - 1.5.0 dev Oct 31, 2013
Diffstat (limited to 'library/WT/Controller')
| -rw-r--r-- | library/WT/Controller/Branches.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/library/WT/Controller/Branches.php b/library/WT/Controller/Branches.php index e4959b503b..d2a536711f 100644 --- a/library/WT/Controller/Branches.php +++ b/library/WT/Controller/Branches.php @@ -40,7 +40,10 @@ class WT_Controller_Branches extends WT_Controller_Page { if ($this->surname) { $this->setPageTitle(/* I18N: %s is a surname */ WT_I18N::translate('Branches of the %s family', WT_Filter::escapeHtml($this->surname))); $this->loadIndividuals(); - $this->loadAncestors(WT_Individual::getInstance(WT_USER_GEDCOM_ID), 1); + $self = WT_Individual::getInstance(WT_USER_GEDCOM_ID); + if ($self) { + $this->loadAncestors(WT_Individual::getInstance(WT_USER_GEDCOM_ID), 1); + } } else { $this->setPageTitle(/* I18N: Branches of a family tree */ WT_I18N::translate('Branches')); } @@ -70,13 +73,13 @@ class WT_Controller_Branches extends WT_Controller_Page { " AND (n_surn=? OR n_surname=?"; $args=array(WT_GED_ID, '_MARNM', $this->surname, $this->surname); if ($this->soundex_std) { - foreach (explode(':', WT_Soundex::soundex_std($surn)) as $value) { + foreach (explode(':', WT_Soundex::soundex_std($this->surname)) as $value) { $sql .= " OR n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; $args[]=$value; } } if ($this->soundex_dm) { - foreach (explode(':', WT_Soundex::soundex_dm($surn)) as $value) { + foreach (explode(':', WT_Soundex::soundex_dm($this->surname)) as $value) { $sql .= " OR n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; $args[]=$value; } |
