Skip to content

Commit a0a4e59

Browse files
authored
fix(report): alias SQL error (#318)
* fix(report): SQL error in VStackBarLifetime report * Update CHANGELOG.md * fix alias
1 parent b1fdac2 commit a0a4e59

File tree

2 files changed

+13
-29
lines changed

2 files changed

+13
-29
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [UNRELEASED]
99

10+
### Fixed
11+
12+
- Fix SQL alias errors for reportVstackbarLifetime chart
13+
1014
## [1.8.9] - 2025-09-30
1115

16+
### Fixed
17+
1218
- Fix SQL alias errors and undefined array keys
1319
- Fix missing `delay` to where clause
1420
- Fix weekly backlog calculation using wrong week reference point (#294)

inc/helpdeskplus.class.php

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __construct($config = [])
7676
Group::getTable() => [
7777
'FKEY' => [
7878
Group::getTable() . '.id',
79-
Group_Ticket::getTable() . '.groups_id',
79+
'gt.groups_id',
8080
],
8181
],
8282
];
@@ -475,33 +475,11 @@ public function reportVstackbarLifetime($config = [])
475475
],
476476
'COUNT' => 'nb',
477477
'FROM' => Ticket::getTable(),
478-
'LEFT JOIN' => [
479-
Ticket_User::getTable() => [
480-
'FKEY' => [
481-
Ticket_User::getTable() . '.tickets_id',
482-
Ticket::getTable() . '.id',
483-
[
484-
'AND' => [
485-
Ticket_User::getTable() . '.type' => Ticket_User::ASSIGN,
486-
],
487-
],
488-
],
489-
],
490-
Group_Ticket::getTable() => [
491-
'FKEY' => [
492-
Group_Ticket::getTable() . '.tickets_id',
493-
Ticket::getTable() . '.id',
494-
[
495-
'AND' => [
496-
'OR' => [
497-
Group_Ticket::getTable() . '.type' => Group_Ticket::REQUESTER,
498-
Group_Ticket::getTable() . '.type' => Group_Ticket::ASSIGN,
499-
],
500-
],
501-
],
502-
],
503-
],
504-
],
478+
'LEFT JOIN' => array_merge(
479+
$this->criteria_join_tu,
480+
$this->criteria_join_gt,
481+
$this->criteria_join_gtr,
482+
),
505483
'WHERE' => array_merge(
506484
[
507485
Ticket::getTable() . '.entities_id' => PluginMreportingCommon::formatWhereEntitiesArray($this->where_entities),
@@ -741,7 +719,7 @@ public function reportHbarTopapplicant($config = [])
741719

742720
$query = [
743721
"SELECT" => [
744-
Group_Ticket::getTable() . '.groups_id',
722+
'gt.groups_id',
745723
Group::getTable() . '.completename',
746724
],
747725
'COUNT' => 'nb',

0 commit comments

Comments
 (0)