Permalink
Browse files

Fix record not loading

  • Loading branch information...
JustCarmen committed May 20, 2018
1 parent e2587d1 commit d6b1941d0674483c672ce59213cadc7e9078c7ab
Showing with 8 additions and 6 deletions.
  1. +8 −6 module.php
View
@@ -128,7 +128,7 @@ public function getSidebarAjaxContent() {
// Implement WT_Module_Sidebar
public function getSidebarContent(Individual $individual) {
// code based on similar in function_print_list.php
global $controller;
global $controller, $WT_TREE;
$controller->addInlineJavascript('
$("#sidebar-header-' . $this->getName() . ' a").text("' . $this->getSidebarTitle() . '");
@@ -185,6 +185,8 @@ function postresearchform(url, params) {
$i = 0;
$total_enabled_plugins = 0;
$record = Individual::getInstance(Filter::get('xref'), $WT_TREE, Filter::get('ged'));
foreach ($this->module()->getPluginList() as $area => $plugins) {
$FRL_PLUGINS = $this->module()->getEnabledPlugins($plugins);
@@ -205,7 +207,7 @@ function postresearchform(url, params) {
$i++;
foreach ($plugins as $label => $plugin) {
if (in_array($label, $FRL_PLUGINS)) {
foreach ($controller->record->getFacts() as $fact) {
foreach ($record->getFacts() as $fact) {
$tag = $fact->getTag();
if ($tag == "NAME") {
$this->primary = $this->module()->getPrimaryName($fact);
@@ -218,10 +220,10 @@ function postresearchform(url, params) {
$link = $plugin->createLinkOnly();
} else {
$this->attrs = [
'birthyear' => $controller->record->getBirthYear(),
'birthplace' => $controller->record->getBirthPlace(),
'deathyear' => $controller->record->getDeathYear(),
'deathplace' => $controller->record->getDeathPlace()
'birthyear' => $record->getBirthYear(),
'birthplace' => $record->getBirthPlace(),
'deathyear' => $record->getDeathYear(),
'deathplace' => $record->getDeathPlace()
];
$link = $plugin->createLink($this->module()->getNames($this->primary, $this->attrs, $plugin->encodePlus()));
}

0 comments on commit d6b1941

Please sign in to comment.