diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/Module/WelcomeBlockModule.php | 2 | ||||
| -rw-r--r-- | app/Tree.php | 36 |
2 files changed, 1 insertions, 37 deletions
diff --git a/app/Module/WelcomeBlockModule.php b/app/Module/WelcomeBlockModule.php index f7bfd743d1..747d29b34e 100644 --- a/app/Module/WelcomeBlockModule.php +++ b/app/Module/WelcomeBlockModule.php @@ -55,7 +55,7 @@ class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface */ public function getBlock(Tree $tree, int $block_id, string $ctype = '', array $cfg = []): string { - $individual = $tree->getSignificantIndividual(); + $individual = $tree->significantIndividual(Auth::user()); $links = []; diff --git a/app/Tree.php b/app/Tree.php index 75ff3b0649..2d533d038e 100644 --- a/app/Tree.php +++ b/app/Tree.php @@ -942,40 +942,4 @@ class Tree return $individual; } - - /** - * Get significant information from this page, to allow other pages such as - * charts and reports to initialise with the same records - * - * @return Individual - */ - public function getSignificantIndividual(): Individual - { - static $individual; // Only query the DB once. - - if (!$individual && $this->getUserPreference(Auth::user(), 'rootid') !== '') { - $individual = Individual::getInstance($this->getUserPreference(Auth::user(), 'rootid'), $this); - } - if (!$individual && $this->getUserPreference(Auth::user(), 'gedcomid') !== '') { - $individual = Individual::getInstance($this->getUserPreference(Auth::user(), 'gedcomid'), $this); - } - if (!$individual) { - $individual = Individual::getInstance($this->getPreference('PEDIGREE_ROOT_ID'), $this); - } - if (!$individual) { - $xref = (string) Database::prepare( - "SELECT MIN(i_id) FROM `##individuals` WHERE i_file = :tree_id" - )->execute([ - 'tree_id' => $this->id(), - ])->fetchOne(); - - $individual = Individual::getInstance($xref, $this); - } - if (!$individual) { - // always return a record - $individual = new Individual('I', '0 @I@ INDI', null, $this); - } - - return $individual; - } } |
