summaryrefslogtreecommitdiff
path: root/app/Services
diff options
context:
space:
mode:
Diffstat (limited to 'app/Services')
-rw-r--r--app/Services/AdminService.php4
-rwxr-xr-x[-rw-r--r--]app/Services/GedcomExportService.php12
2 files changed, 8 insertions, 8 deletions
diff --git a/app/Services/AdminService.php b/app/Services/AdminService.php
index 31c372e2d1..0b053257dd 100644
--- a/app/Services/AdminService.php
+++ b/app/Services/AdminService.php
@@ -157,8 +157,8 @@ class AdminService
$families = DB::table('families')
->where('f_file', '=', $tree->id())
- ->groupBy([new Expression('LEAST(f_husb, f_wife)')])
- ->groupBy([new Expression('GREATEST(f_husb, f_wife)')])
+ ->groupBy([new Expression( DB::driverName() === DB::FIREBIRD ? 'MINVALUE(f_husb, f_wife)' : 'LEAST(f_husb, f_wife)' )])
+ ->groupBy([new Expression( DB::driverName() === DB::FIREBIRD ? 'MAXVALUE(f_husb, f_wife)' : 'GREATEST(f_husb, f_wife)' )])
->having(new Expression('COUNT(f_id)'), '>', '1')
->select([new Expression(DB::groupConcat('f_id') . ' AS xrefs')])
->orderBy('xrefs')
diff --git a/app/Services/GedcomExportService.php b/app/Services/GedcomExportService.php
index 18018d1e1c..d5fcb1bdaa 100644..100755
--- a/app/Services/GedcomExportService.php
+++ b/app/Services/GedcomExportService.php
@@ -236,7 +236,7 @@ class GedcomExportService
$datum->f_gedcom ??
$datum->s_gedcom ??
$datum->m_gedcom ??
- $datum->o_gedcom;
+ $datum->o_gedcom ?? '';
}
if ($media_path !== null && preg_match('/^0 @' . Gedcom::REGEX_XREF . '@ OBJE/', $gedcom) === 1) {
@@ -378,7 +378,7 @@ class GedcomExportService
if ($sort_by_xref) {
$query
- ->orderBy(new Expression('LENGTH(f_id)'))
+ ->orderBy(new Expression((DB::driverName() === DB::FIREBIRD ? 'CHAR_' : '' ).'LENGTH(f_id)'))
->orderBy('f_id');
}
@@ -393,7 +393,7 @@ class GedcomExportService
if ($sort_by_xref) {
$query
- ->orderBy(new Expression('LENGTH(i_id)'))
+ ->orderBy(new Expression((DB::driverName() === DB::FIREBIRD ? 'CHAR_' : '' ).'LENGTH(i_id)'))
->orderBy('i_id');
}
@@ -408,7 +408,7 @@ class GedcomExportService
if ($sort_by_xref) {
$query
- ->orderBy(new Expression('LENGTH(s_id)'))
+ ->orderBy(new Expression((DB::driverName() === DB::FIREBIRD ? 'CHAR_' : '' ).'LENGTH(s_id)'))
->orderBy('s_id');
}
@@ -423,7 +423,7 @@ class GedcomExportService
if ($sort_by_xref) {
$query
- ->orderBy(new Expression('LENGTH(m_id)'))
+ ->orderBy(new Expression((DB::driverName() === DB::FIREBIRD ? 'CHAR_' : '' ).'LENGTH(m_id)'))
->orderBy('m_id');
}
@@ -440,7 +440,7 @@ class GedcomExportService
if ($sort_by_xref) {
$query
->orderBy('o_type')
- ->orderBy(new Expression('LENGTH(o_id)'))
+ ->orderBy(new Expression((DB::driverName() === DB::FIREBIRD ? 'CHAR_' : '' ).'LENGTH(o_id)'))
->orderBy('o_id');
}