[pkg-nagios-changes] [Git][nagios-team/pkg-icingaweb2][master] 2 commits: Add upstream patches to replace ours.
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Tue Jul 5 15:22:41 BST 2022
Bas Couwenberg pushed to branch master at Debian Nagios Maintainer Group / pkg-icingaweb2
Commits:
74f91781 by Bas Couwenberg at 2022-07-05T16:16:28+02:00
Add upstream patches to replace ours.
- - - - -
b687d18a by Bas Couwenberg at 2022-07-05T16:16:28+02:00
Set distribution to unstable.
- - - - -
5 changed files:
- debian/changelog
- − debian/patches/0001-Fix-Event-Grid-SQLSTATE-error.patch
- + debian/patches/pr4854-Fix-incorrect-history-time-and-date.patch
- debian/patches/0001-Fix-deprecated-warning-in-setup-module.patch → debian/patches/pr4861-Fix-depricated-warning-in-setup-wizard.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+icingaweb2 (2.11.0-4) unstable; urgency=medium
+
+ * Team upload.
+ * Add upstream patches to replace ours.
+
+ -- Bas Couwenberg <sebastic at debian.org> Tue, 05 Jul 2022 16:11:41 +0200
+
icingaweb2 (2.11.0-3) unstable; urgency=medium
* Team upload.
=====================================
debian/patches/0001-Fix-Event-Grid-SQLSTATE-error.patch deleted
=====================================
@@ -1,25 +0,0 @@
-Description: Fix Event Grid SQLSTATE error.
-Author: Bas Couwenberg <sebastic at xs4all.nl>
-Bug: https://github.com/Icinga/icingaweb2/issues/4852
-Forwarded: https://github.com/Icinga/icingaweb2/pull/4855
-
---- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php
-+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php
-@@ -11,7 +11,7 @@ abstract class EventgridQuery extends St
- * @var array
- */
- protected $additionalColumns = array(
-- 'day' => 'DATE(FROM_UNIXTIME(sth.timestamp))',
-+ 'day' => 'DATE(sth.timestamp)',
- 'cnt_up' => "SUM(CASE WHEN sth.state = 0 THEN 1 ELSE 0 END)",
- 'cnt_down_hard' => "SUM(CASE WHEN sth.state = 1 AND sth.type = 'hard_state' THEN 1 ELSE 0 END)",
- 'cnt_down' => "SUM(CASE WHEN sth.state = 1 THEN 1 ELSE 0 END)",
-@@ -35,7 +35,7 @@ abstract class EventgridQuery extends St
- parent::joinBaseTables();
- $this->requireVirtualTable('history');
- $this->columnMap['statehistory'] += $this->additionalColumns;
-- $this->select->group(array('DATE(FROM_UNIXTIME(sth.timestamp))'));
-+ $this->select->group(array('DATE(sth.timestamp)'));
- }
-
- /**
=====================================
debian/patches/pr4854-Fix-incorrect-history-time-and-date.patch
=====================================
@@ -0,0 +1,627 @@
+Description: Fix incorrect history time and date
+Author: Johannes Meyer <johannes.meyer at icinga.com>
+Origin: https://github.com/Icinga/icingaweb2/pull/4854
+Bug: https://github.com/Icinga/icingaweb2/issues/4853
+
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommentdeletionhistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommentdeletionhistoryQuery.php
+@@ -3,18 +3,24 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for host comment removal records
+ */
+ class HostcommentdeletionhistoryQuery extends HostcommenthistoryQuery
+ {
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'hch.deletion_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('hch.deletion_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommenthistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommenthistoryQuery.php
+@@ -3,6 +3,9 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for host comment history records
+ */
+@@ -40,7 +43,7 @@ class HostcommenthistoryQuery extends Id
+ 'object_type' => '(\'host\')',
+ 'output' => "('[' || hch.author_name || '] ' || hch.comment_data)",
+ 'state' => '(-1)',
+- 'timestamp' => 'hch.comment_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)',
+ 'type' => "(CASE hch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)"
+ ),
+ 'hostgroups' => array(
+@@ -68,13 +71,16 @@ class HostcommenthistoryQuery extends Id
+ )
+ );
+
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'hch.comment_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('hch.comment_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php
+@@ -3,18 +3,24 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for host downtime end history records
+ */
+ class HostdowntimeendhistoryQuery extends HostdowntimestarthistoryQuery
+ {
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'hdh.actual_end_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('hdh.actual_end_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php
+@@ -3,6 +3,9 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for host downtime start history records
+ */
+@@ -40,7 +43,7 @@ class HostdowntimestarthistoryQuery exte
+ 'object_type' => '(\'host\')',
+ 'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)",
+ 'state' => '(-1)',
+- 'timestamp' => 'hdh.actual_start_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)',
+ 'type' => "('dt_start')"
+ ),
+ 'hostgroups' => array(
+@@ -68,13 +71,16 @@ class HostdowntimestarthistoryQuery exte
+ )
+ );
+
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'hdh.actual_start_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('hdh.actual_start_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostflappingstarthistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostflappingstarthistoryQuery.php
+@@ -3,6 +3,9 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for host flapping start history records
+ */
+@@ -40,7 +43,7 @@ class HostflappingstarthistoryQuery exte
+ 'object_type' => '(\'host\')',
+ 'output' => '(hfh.percent_state_change || \'\')',
+ 'state' => '(-1)',
+- 'timestamp' => 'hfh.event_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(hfh.event_time)',
+ 'type' => '(\'flapping\')'
+ ),
+ 'hostgroups' => array(
+@@ -68,13 +71,16 @@ class HostflappingstarthistoryQuery exte
+ )
+ );
+
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'hfh.event_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('hfh.event_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php
+@@ -40,7 +40,7 @@ class HostnotificationQuery extends IdoQ
+ 'history' => array(
+ 'output' => null,
+ 'state' => 'hn.state',
+- 'timestamp' => 'hn.start_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(hn.start_time)',
+ 'type' => '
+ CASE hn.notification_reason
+ WHEN 1 THEN \'notification_ack\'
+@@ -63,7 +63,7 @@ class HostnotificationQuery extends IdoQ
+ 'notification_output' => 'hn.output',
+ 'notification_reason' => 'hn.notification_reason',
+ 'notification_state' => 'hn.state',
+- 'notification_timestamp' => 'hn.start_time',
++ 'notification_timestamp' => 'UNIX_TIMESTAMP(hn.start_time)',
+ 'object_type' => '(\'host\')'
+ ),
+ 'servicegroups' => array(
+@@ -81,24 +81,24 @@ class HostnotificationQuery extends IdoQ
+
+ protected function requireFilterColumns(Filter $filter)
+ {
+- if ($filter instanceof FilterExpression && $filter->getColumn() === 'output') {
+- $this->requireColumn($filter->getColumn());
+- $filter->setColumn('hn.output');
+- return null;
++ if ($filter instanceof FilterExpression) {
++ switch ($filter->getColumn()) {
++ case 'output':
++ $this->requireColumn('output');
++ $filter->setColumn('hn.output');
++ return null;
++ case 'timestamp':
++ case 'notification_timestamp':
++ $this->requireColumn($filter->getColumn());
++ $filter->setColumn('hn.start_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
++ }
+ }
+
+ return parent::requireFilterColumns($filter);
+ }
+
+- public function isTimestamp($field)
+- {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'hn.start_time';
+- }
+-
+- return true;
+- }
+-
+ /**
+ * {@inheritdoc}
+ */
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatehistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatehistoryQuery.php
+@@ -3,6 +3,9 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for host state history records
+ */
+@@ -73,18 +76,36 @@ class HoststatehistoryQuery extends IdoQ
+ 'object_type' => '(\'host\')',
+ 'output' => '(CASE WHEN hh.state_type = 1 THEN hh.output ELSE \'[ \' || hh.current_check_attempt || \'/\' || hh.max_check_attempts || \' ] \' || hh.output END)',
+ 'state' => 'hh.state',
+- 'timestamp' => 'hh.state_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(hh.state_time)',
+ 'type' => "(CASE WHEN hh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)"
+ ),
+ );
+
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'hh.state_time';
++ if ($filter instanceof FilterExpression) {
++ switch ($filter->getColumn()) {
++ case 'timestamp':
++ $this->requireColumn('timestamp');
++ $filter->setColumn('hh.state_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
++ case 'type':
++ if (! is_array($filter->getExpression())) {
++ $this->requireColumn('type');
++ $filter->setColumn('hh.state_type');
++ if (isset($this->types[$filter->getExpression()])) {
++ $filter->setExpression($this->types[$filter->getExpression()]);
++ } else {
++ $filter->setExpression(-1);
++ }
++
++ return null;
++ }
++ }
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommentdeletionhistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommentdeletionhistoryQuery.php
+@@ -3,18 +3,24 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for service comment removal records
+ */
+ class ServicecommentdeletionhistoryQuery extends ServicecommenthistoryQuery
+ {
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'sch.deletion_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('sch.deletion_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommenthistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommenthistoryQuery.php
+@@ -3,6 +3,9 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for service comment history records
+ */
+@@ -44,7 +47,7 @@ class ServicecommenthistoryQuery extends
+ 'service_host' => 'so.name1 COLLATE latin1_general_ci',
+ 'service_host_name' => 'so.name1',
+ 'state' => '(-1)',
+- 'timestamp' => 'sch.comment_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(sch.comment_time)',
+ 'type' => "(CASE sch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)"
+ ),
+ 'hostgroups' => array(
+@@ -69,13 +72,16 @@ class ServicecommenthistoryQuery extends
+ )
+ );
+
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'sch.comment_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('sch.comment_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeendhistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeendhistoryQuery.php
+@@ -3,18 +3,24 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for host downtime end history records
+ */
+ class ServicedowntimeendhistoryQuery extends ServicedowntimestarthistoryQuery
+ {
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'sdh.actual_end_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('sdh.actual_end_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php
+@@ -3,6 +3,9 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for service downtime start history records
+ */
+@@ -44,7 +47,7 @@ class ServicedowntimestarthistoryQuery e
+ 'service_host' => 'so.name1 COLLATE latin1_general_ci',
+ 'service_host_name' => 'so.name1',
+ 'state' => '(-1)',
+- 'timestamp' => 'sdh.actual_start_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(sdh.actual_start_time)',
+ 'type' => "('dt_start')"
+ ),
+ 'hostgroups' => array(
+@@ -69,13 +72,16 @@ class ServicedowntimestarthistoryQuery e
+ )
+ );
+
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'sdh.actual_start_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('sdh.actual_start_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServiceflappingstarthistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServiceflappingstarthistoryQuery.php
+@@ -3,6 +3,9 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for service flapping start history records
+ */
+@@ -43,7 +46,7 @@ class ServiceflappingstarthistoryQuery e
+ 'service_description' => 'so.name2',
+ 'service_host_name' => 'so.name1',
+ 'state' => '(-1)',
+- 'timestamp' => 'sfh.event_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(sfh.event_time)',
+ 'type' => "('flapping')"
+ ),
+ 'hostgroups' => array(
+@@ -68,13 +71,16 @@ class ServiceflappingstarthistoryQuery e
+ )
+ );
+
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'sfh.event_time';
++ if ($filter instanceof FilterExpression && $filter->getColumn() === 'timestamp') {
++ $this->requireColumn('timestamp');
++ $filter->setColumn('sfh.event_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php
+@@ -31,7 +31,7 @@ class ServicenotificationQuery extends I
+ 'history' => array(
+ 'output' => null,
+ 'state' => 'sn.state',
+- 'timestamp' => 'sn.start_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(sn.start_time)',
+ 'type' => '
+ CASE sn.notification_reason
+ WHEN 1 THEN \'notification_ack\'
+@@ -63,7 +63,7 @@ class ServicenotificationQuery extends I
+ 'notification_output' => 'sn.output',
+ 'notification_reason' => 'sn.notification_reason',
+ 'notification_state' => 'sn.state',
+- 'notification_timestamp' => 'sn.start_time',
++ 'notification_timestamp' => 'UNIX_TIMESTAMP(sn.start_time)',
+ 'object_type' => '(\'service\')',
+ 'service' => 'so.name2 COLLATE latin1_general_ci',
+ 'service_description' => 'so.name2',
+@@ -81,24 +81,24 @@ class ServicenotificationQuery extends I
+
+ protected function requireFilterColumns(Filter $filter)
+ {
+- if ($filter instanceof FilterExpression && $filter->getColumn() === 'output') {
+- $this->requireColumn($filter->getColumn());
+- $filter->setColumn('sn.output');
+- return null;
++ if ($filter instanceof FilterExpression) {
++ switch ($filter->getColumn()) {
++ case 'output':
++ $this->requireColumn('output');
++ $filter->setColumn('sn.output');
++ return null;
++ case 'timestamp':
++ case 'notification_timestamp':
++ $this->requireColumn($filter->getColumn());
++ $filter->setColumn('sn.start_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
++ }
+ }
+
+ return parent::requireFilterColumns($filter);
+ }
+
+- public function isTimestamp($field)
+- {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'sn.start_time';
+- }
+-
+- return true;
+- }
+-
+ /**
+ * {@inheritdoc}
+ */
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatehistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatehistoryQuery.php
+@@ -3,6 +3,9 @@
+
+ namespace Icinga\Module\Monitoring\Backend\Ido\Query;
+
++use Icinga\Data\Filter\Filter;
++use Icinga\Data\Filter\FilterExpression;
++
+ /**
+ * Query for service state history records
+ */
+@@ -74,18 +77,36 @@ class ServicestatehistoryQuery extends I
+ 'service_host' => 'so.name1 COLLATE latin1_general_ci',
+ 'service_host_name' => 'so.name1',
+ 'state' => 'sh.state',
+- 'timestamp' => 'sh.state_time',
++ 'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)',
+ 'type' => "(CASE WHEN sh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)"
+ ),
+ );
+
+- public function isTimestamp($field)
++ protected function requireFilterColumns(Filter $filter)
+ {
+- if (! parent::isTimestamp($field)) {
+- return $field === 'sh.state_time';
++ if ($filter instanceof FilterExpression) {
++ switch ($filter->getColumn()) {
++ case 'timestamp':
++ $this->requireColumn('timestamp');
++ $filter->setColumn('sh.state_time');
++ $filter->setExpression($this->timestampForSql($this->valueToTimestamp($filter->getExpression())));
++ return null;
++ case 'type':
++ if (! is_array($filter->getExpression())) {
++ $this->requireColumn('type');
++ $filter->setColumn('sh.state_type');
++ if (isset($this->types[$filter->getExpression()])) {
++ $filter->setExpression($this->types[$filter->getExpression()]);
++ } else {
++ $filter->setExpression(-1);
++ }
++
++ return null;
++ }
++ }
+ }
+
+- return true;
++ return parent::requireFilterColumns($filter);
+ }
+
+ /**
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
+@@ -1049,7 +1049,7 @@ abstract class IdoQuery extends DbQuery
+ *
+ * This calls requireVirtualTable if needed
+ *
+- * @param $alias The alias of the column to require
++ * @param string $alias The alias of the column to require
+ *
+ * @return $this Fluent interface
+ * @see IdoQuery::requireVirtualTable The method initializing required joins
+--- a/library/Icinga/Data/Db/DbQuery.php
++++ b/library/Icinga/Data/Db/DbQuery.php
+@@ -234,7 +234,7 @@ class DbQuery extends SimpleQuery
+ $value = (int) $value;
+ }
+
+- return $this->timestampForSql($value);
++ return $value;
+ }
+
+ /**
=====================================
debian/patches/0001-Fix-deprecated-warning-in-setup-module.patch → debian/patches/pr4861-Fix-depricated-warning-in-setup-wizard.patch
=====================================
@@ -1,7 +1,7 @@
-Description: Fix deprecated warning in setup module.
-Author: Bas Couwenberg <sebastic at xs4all.nl>
+Description: Module: Don't pass null as param to `class_exists()`
+Author: Sukhwinder Dhillon <sukhwinder33445 at gmail.com>
+Origin: https://github.com/Icinga/icingaweb2/pull/4861
Bug: https://github.com/Icinga/icingaweb2/issues/4849
-Forwarded: https://github.com/Icinga/icingaweb2/issues/4849#issuecomment-1172881592
--- a/library/Icinga/Application/Modules/Module.php
+++ b/library/Icinga/Application/Modules/Module.php
@@ -10,7 +10,7 @@ Forwarded: https://github.com/Icinga/icingaweb2/issues/4849#issuecomment-1172881
{
$this->launchConfigScript();
- if (class_exists($this->setupWizard)) {
-+ if (!is_null($this->setupWizard) && class_exists($this->setupWizard)) {
++ if ($this->setupWizard && class_exists($this->setupWizard)) {
$wizard = new $this->setupWizard;
return $wizard instanceof SetupWizard;
}
=====================================
debian/patches/series
=====================================
@@ -1,2 +1,2 @@
-0001-Fix-Event-Grid-SQLSTATE-error.patch
-0001-Fix-deprecated-warning-in-setup-module.patch
+pr4854-Fix-incorrect-history-time-and-date.patch
+pr4861-Fix-depricated-warning-in-setup-wizard.patch
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-icingaweb2/-/compare/5bd2dca2251fa4a90626d21c1c3d25b9454d143d...b687d18a63f74911d7cd7ef830232265b589981e
--
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-icingaweb2/-/compare/5bd2dca2251fa4a90626d21c1c3d25b9454d143d...b687d18a63f74911d7cd7ef830232265b589981e
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20220705/ae787af7/attachment-0001.htm>
More information about the pkg-nagios-changes
mailing list