Skip to content

Commit 75afc34

Browse files
committed
Fix(Reporting): Fix LIMIT clause
1 parent 5c05d65 commit 75afc34

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

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

88
## [UNRELEASED]
99

10+
- Fix `limit` clause
11+
1012
## [1.8.10] - 2025-12-05
1113

1214
### Fixed

inc/helpdeskplus.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ public function reportHbarTopcategory($config = [])
661661

662662
//Init delay value
663663
$delay = PluginMreportingCommon::getCriteriaDate('glpi_tickets.date', $config['delay'], $config['randname']);
664-
$limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? '0, ' . $_SESSION['mreporting_values']['glpilist_limit'] : '0, 20';
664+
$limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? $_SESSION['mreporting_values']['glpilist_limit'] : 20;
665665

666666
$query = [
667667
"SELECT" => [
@@ -694,6 +694,7 @@ public function reportHbarTopcategory($config = [])
694694
$query['WHERE']['AND'] = $delay;
695695

696696
$result = $DB->request($query);
697+
Toolbox::logDebug($DB->request($query)->getSql());
697698
foreach ($result as $data) {
698699
if (empty($data['completename'])) {
699700
$data['completename'] = __('None');
@@ -715,7 +716,7 @@ public function reportHbarTopapplicant($config = [])
715716

716717
//Init delay value
717718
$delay = PluginMreportingCommon::getCriteriaDate('glpi_tickets.date', $config['delay'], $config['randname']);
718-
$limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? '0, ' . $_SESSION['mreporting_values']['glpilist_limit'] : '0, 20';
719+
$limit = isset($_SESSION['mreporting_values']['glpilist_limit']) ? $_SESSION['mreporting_values']['glpilist_limit'] : 20;
719720

720721
$query = [
721722
"SELECT" => [

0 commit comments

Comments
 (0)