Skip to content

Commit

Permalink
Merge branch 'fisharebest:main' into local_mods_on_2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ddrury authored Nov 27, 2024
2 parents 2cfb173 + f9645b3 commit f465f49
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion app/Elements/NoteStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function labelValue(string $value, Tree $tree): string
'</button> ' .
'<span class="label">' . $label . ':</span> ' . $first_line .
'</div>' .
'<div id="' . e($id) . '" class="ps-4 collapse ut' . ($expanded ? 'show' : '') . '">' .
'<div id="' . e($id) . '" class="ps-4 collapse ut' . ($expanded ? ' show' : '') . '">' .
$html .
'</div>';
}
Expand Down
29 changes: 12 additions & 17 deletions app/GedcomRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,23 +312,18 @@ public function privatizeGedcom(int $access_level): string
}

// Remove links to missing and private records
$patterns = [
'/\n1 ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@(?:\n[2-9].*)*/',
'/\n2 ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@(?:\n[3-9].*)*/',
'/\n3 ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@(?:\n[4-9].*)*/',
'/\n4 ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@(?:\n[5-9].*)*/',
];

foreach ($patterns as $pattern) {
preg_match_all($pattern, $gedcom, $matches, PREG_SET_ORDER);

foreach ($matches as $match) {
$xref = $match[1];
$record = Registry::gedcomRecordFactory()->make($xref, $this->tree);

if ($record === null || !$record->canShow($access_level)) {
$gedcom = str_replace($match[0], '', $gedcom);
}
$pattern = '/\n(\d) ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@/';
preg_match_all($pattern, $gedcom, $matches, PREG_SET_ORDER);

foreach ($matches as $match) {
$xref = $match[2];
$record = Registry::gedcomRecordFactory()->make($xref, $this->tree);

if ($record === null || !$record->canShow($access_level)) {
$level = $match[1];
$next = 1 + (int) $level;
$pattern = '/\n' . $level . ' ' . Gedcom::REGEX_TAG . ' @' . $xref . '@(\n[' . $next . '-9].*)*/';
$gedcom = preg_replace($pattern, '', $gedcom);
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/Module/FamilyListModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

use Fisharebest\Webtrees\I18N;

class FamilyListModule extends IndividualListModule
class FamilyListModule extends AbstractIndividualListModule
{
public function title(): string
{
Expand Down
8 changes: 7 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,12 @@ parameters:
count: 1
path: app/GedcomRecord.php

-
message: '#^Method Fisharebest\\Webtrees\\GedcomRecord\:\:privatizeGedcom\(\) should return string but returns string\|null\.$#'
identifier: return.type
count: 1
path: app/GedcomRecord.php

-
message: '#^Parameter \#1 \$array of function array_shift expects array, list\<string\>\|false given\.$#'
identifier: argument.type
Expand Down Expand Up @@ -1149,7 +1155,7 @@ parameters:
-
message: '#^Parameter \#3 \$subject of function preg_replace expects array\<float\|int\|string\>\|string, string\|null given\.$#'
identifier: argument.type
count: 1
count: 2
path: app/GedcomRecord.php

-
Expand Down
16 changes: 8 additions & 8 deletions resources/lang/da/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ msgstr ""
"Project-Id-Version: webtrees\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-19 13:12+0000\n"
"PO-Revision-Date: 2024-10-07 12:22+0000\n"
"Last-Translator: Greg Roach <[email protected]>\n"
"PO-Revision-Date: 2024-11-26 04:15+0000\n"
"Last-Translator: stc4000 <[email protected]>\n"
"Language-Team: Danish <https://translate.webtrees.net/projects/webtrees/"
"webtrees/da/>\n"
"Language: da\n"
Expand All @@ -25,7 +25,7 @@ msgstr ""
#: resources/xml/reports/ahnentafel_report.xml:333
#: resources/xml/reports/ahnentafel_report.xml:358
msgid " but the details are unknown"
msgstr " men nærmere detaljer er ukendte"
msgstr " men detaljerne er ukendte"

#: resources/xml/reports/ahnentafel_report.xml:160
#: resources/xml/reports/ahnentafel_report.xml:188
Expand Down Expand Up @@ -14765,7 +14765,7 @@ msgstr "Der er ingen hændelser for denne person."
#: app/Module/IndividualListModule.php:220
#, php-format
msgid "There are no individuals with the surname “%s”"
msgstr ""
msgstr "Der findes ingen personer med efternavnet “%s”"

#: app/Http/RequestHandlers/ManageMediaData.php:327
msgid "There are no links to this media object."
Expand Down Expand Up @@ -17178,7 +17178,7 @@ msgstr "fortsæt"
#: app/Elements/GeneatiqueAct.php:40
msgctxt "NOUN"
msgid "copy"
msgstr ""
msgstr "kopi"

#. I18N: A button label.
#: resources/views/admin/trees-create.phtml:57
Expand Down Expand Up @@ -17360,7 +17360,7 @@ msgstr "eksportfil"
#: app/Elements/GeneatiqueAct.php:42
msgctxt "NOUN"
msgid "extract"
msgstr ""
msgstr "uddrag"

#: app/Http/RequestHandlers/TreePreferencesPage.php:113
#: resources/xml/reports/fact_sources.xml:6
Expand Down Expand Up @@ -19862,7 +19862,7 @@ msgstr "af"

#: app/Elements/GeneatiqueAct.php:38
msgid "online"
msgstr ""
msgstr "online"

#: app/Services/RelationshipService.php:354
msgid "parent"
Expand Down Expand Up @@ -19918,7 +19918,7 @@ msgstr "procent"

#: app/Elements/GeneatiqueAct.php:41
msgid "photocopy"
msgstr ""
msgstr "fotokopi"

#. I18N: https://en.wikipedia.org/wiki/Plain_text
#: app/Http/RequestHandlers/TreePreferencesPage.php:106
Expand Down

0 comments on commit f465f49

Please sign in to comment.