record && $this->record->canEdit()) { $broken_links=0; foreach ($this->record->getFacts('HUSB|WIFE|CHIL|FAMS|FAMC|SOUR|REPO|OBJE') as $fact) { // Not NOTE! if (!$fact->isOld() && $fact->getTarget() === null) { $this->record->deleteFact($fact->getFactId(), false); WT_FlashMessages::addMessage(/* I18N: %s are names of records, such as sources, repositories or individuals */ WT_I18N::translate('The link from ā€œ%1$sā€ to ā€œ%2$sā€ has been deleted.', $this->record->getFullName(), $fact->getValue())); $broken_links = true; } } if ($broken_links) { // Reload the updated family $this->record = WT_GedcomRecord::getInstance($this->record->getXref()); } } parent::__construct(); // We want robots to index this page $this->setMetaRobots('index,follow'); // Set a page title if ($this->record) { $this->setCanonicalUrl($this->record->getHtmlUrl()); if ($this->record->canShowName()) { // e.g. "John Doe" or "1881 Census of Wales" $this->setPageTitle($this->record->getFullName()); } else { // e.g. "Individual" or "Source" $record = $this->record; $this->setPageTitle(WT_Gedcom_Tag::getLabel($record::RECORD_TYPE)); } } else { // No such record $this->setPageTitle(WT_I18N::translate('Private')); } } }