summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2026-02-05 23:29:29 +0000
committerGreg Roach <greg@subaqua.co.uk>2026-02-05 23:42:16 +0000
commit8f58063d78099e3362360d9499da7e18c14dbd86 (patch)
tree1f5212ffa925aef446019ee613cfaffff9cbce0f
parent5927ea37bec69d29e76290d3928609cb598d080b (diff)
downloadwebtrees-8f58063d78099e3362360d9499da7e18c14dbd86.tar.gz
webtrees-8f58063d78099e3362360d9499da7e18c14dbd86.tar.bz2
webtrees-8f58063d78099e3362360d9499da7e18c14dbd86.zip
fix: HEAD:SUBM missing from GEDCOM export when privacy filtering disabled and privacy rules would block them.
-rw-r--r--app/Services/GedcomExportService.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/Services/GedcomExportService.php b/app/Services/GedcomExportService.php
index 72d4558d02..004e266640 100644
--- a/app/Services/GedcomExportService.php
+++ b/app/Services/GedcomExportService.php
@@ -188,14 +188,14 @@ class GedcomExportService
if ($records instanceof Collection) {
// Export just these records - e.g. from clippings cart.
$data = [
- new Collection([$this->createHeader($tree, $encoding, false)]),
+ new Collection([$this->createHeader($tree, $encoding, false, $access_level)]),
$records,
new Collection(['0 TRLR']),
];
} elseif ($access_level === Auth::PRIV_HIDE) {
// If we will be applying privacy filters, then we will need the GEDCOM record objects.
$data = [
- new Collection([$this->createHeader($tree, $encoding, true)]),
+ new Collection([$this->createHeader($tree, $encoding, true, $access_level)]),
$this->individualQuery($tree, $sort_by_xref)->cursor(),
$this->familyQuery($tree, $sort_by_xref)->cursor(),
$this->sourceQuery($tree, $sort_by_xref)->cursor(),
@@ -208,7 +208,7 @@ class GedcomExportService
Registry::cache()->array()->remember(AbstractGedcomRecordFactory::class . $tree->id(), static fn (): Collection => new Collection());
$data = [
- new Collection([$this->createHeader($tree, $encoding, true)]),
+ new Collection([$this->createHeader($tree, $encoding, true, $access_level)]),
$this->individualQuery($tree, $sort_by_xref)->get()->map(Registry::individualFactory()->mapper($tree)),
$this->familyQuery($tree, $sort_by_xref)->get()->map(Registry::familyFactory()->mapper($tree)),
$this->sourceQuery($tree, $sort_by_xref)->get()->map(Registry::sourceFactory()->mapper($tree)),
@@ -288,7 +288,7 @@ class GedcomExportService
return $stream;
}
- public function createHeader(Tree $tree, string $encoding, bool $include_sub): string
+ public function createHeader(Tree $tree, string $encoding, bool $include_sub, int $access_level): string
{
// Force a ".ged" suffix
$filename = $tree->name();
@@ -322,12 +322,12 @@ class GedcomExportService
// There should always be a header record.
if ($header instanceof Header) {
- foreach ($header->facts(['COPR', 'LANG', 'PLAC', 'NOTE']) as $fact) {
+ foreach ($header->facts(['COPR', 'LANG', 'PLAC', 'NOTE'], false, $access_level) as $fact) {
$gedcom .= "\n" . $fact->gedcom();
}
if ($include_sub) {
- foreach ($header->facts(['SUBM', 'SUBN']) as $fact) {
+ foreach ($header->facts(['SUBM', 'SUBN'], false, $access_level) as $fact) {
$gedcom .= "\n" . $fact->gedcom();
}
}