diff options
| -rw-r--r-- | app/Fact.php | 7 | ||||
| -rw-r--r-- | app/Module/MediaTabModule.php | 2 | ||||
| -rw-r--r-- | app/Module/NotesTabModule.php | 2 | ||||
| -rw-r--r-- | app/Module/SourcesTabModule.php | 2 | ||||
| -rw-r--r-- | app/Services/CalendarService.php | 2 |
5 files changed, 8 insertions, 7 deletions
diff --git a/app/Fact.php b/app/Fact.php index 3532ddf29d..5ab1e75a90 100644 --- a/app/Fact.php +++ b/app/Fact.php @@ -20,6 +20,7 @@ namespace Fisharebest\Webtrees; use Closure; use Fisharebest\Webtrees\Functions\FunctionsPrint; use Fisharebest\Webtrees\Services\GedcomService; +use Illuminate\Support\Collection; use InvalidArgumentException; /** @@ -690,9 +691,9 @@ class Fact * * @param Fact[] $unsorted * - * @return Fact[] + * @return Collection|Fact[] */ - public static function sortFacts($unsorted): array + public static function sortFacts($unsorted): Collection { $dated = []; $nondated = []; @@ -739,7 +740,7 @@ class Fact $j++; } - return $sorted; + return new Collection($sorted); } /** diff --git a/app/Module/MediaTabModule.php b/app/Module/MediaTabModule.php index 638be5777d..9dbc6d5c9d 100644 --- a/app/Module/MediaTabModule.php +++ b/app/Module/MediaTabModule.php @@ -126,7 +126,7 @@ class MediaTabModule extends AbstractModule implements ModuleTabInterface $this->facts[] = $fact; } } - $this->facts = Fact::sortFacts($this->facts); + $this->facts = Fact::sortFacts($this->facts)->all(); } return $this->facts; diff --git a/app/Module/NotesTabModule.php b/app/Module/NotesTabModule.php index f4a960092f..492328e7ec 100644 --- a/app/Module/NotesTabModule.php +++ b/app/Module/NotesTabModule.php @@ -125,7 +125,7 @@ class NotesTabModule extends AbstractModule implements ModuleTabInterface $this->facts[] = $fact; } } - $this->facts = Fact::sortFacts($this->facts); + $this->facts = Fact::sortFacts($this->facts)->all(); } return $this->facts; diff --git a/app/Module/SourcesTabModule.php b/app/Module/SourcesTabModule.php index 1c55a20b3a..f122a279f8 100644 --- a/app/Module/SourcesTabModule.php +++ b/app/Module/SourcesTabModule.php @@ -125,7 +125,7 @@ class SourcesTabModule extends AbstractModule implements ModuleTabInterface $this->facts[] = $fact; } } - $this->facts = Fact::sortFacts($this->facts); + $this->facts = Fact::sortFacts($this->facts)->all(); } return $this->facts; diff --git a/app/Services/CalendarService.php b/app/Services/CalendarService.php index fc68c39e6f..645f10215e 100644 --- a/app/Services/CalendarService.php +++ b/app/Services/CalendarService.php @@ -196,7 +196,7 @@ class CalendarService switch ($sort_by) { case 'anniv': - $facts = Fact::sortFacts($facts); + $facts = Fact::sortFacts($facts)->all(); break; case 'alpha': |
