From 6f0fd7d44de11efb4631ccb5730c0b337c570560 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 27 Apr 2015 13:06:55 +0200 Subject: [PATCH 1/6] Remove right petrol border from plugin output in the host and service detail views resolves #8967 --- modules/monitoring/public/css/module.less | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index 4cc68e18e..97d236966 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -32,7 +32,6 @@ p.pluginoutput { } div.pluginoutput { - border-right: solid 5px @colorPetrol; overflow: auto; color: black; margin-bottom: 1em; From c839cc0b0884fa33fa0cf95c5af84c60af6f3a61 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 27 Apr 2015 13:16:54 +0200 Subject: [PATCH 2/6] Remove exclamation mark from the notification "Authentication order updated!" resolves #8960 --- application/forms/Config/AuthenticationBackendReorderForm.php | 2 +- application/locale/it_IT/LC_MESSAGES/icinga.po | 2 +- application/locale/pt_BR/LC_MESSAGES/icinga.po | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/forms/Config/AuthenticationBackendReorderForm.php b/application/forms/Config/AuthenticationBackendReorderForm.php index e4ac90c12..34f20d851 100644 --- a/application/forms/Config/AuthenticationBackendReorderForm.php +++ b/application/forms/Config/AuthenticationBackendReorderForm.php @@ -51,7 +51,7 @@ class AuthenticationBackendReorderForm extends ConfigForm try { if ($configForm->move($backendName, $position)->save()) { - Notification::success($this->translate('Authentication order updated!')); + Notification::success($this->translate('Authentication order updated')); } else { return false; } diff --git a/application/locale/it_IT/LC_MESSAGES/icinga.po b/application/locale/it_IT/LC_MESSAGES/icinga.po index 2b867ca14..c61195216 100644 --- a/application/locale/it_IT/LC_MESSAGES/icinga.po +++ b/application/locale/it_IT/LC_MESSAGES/icinga.po @@ -199,7 +199,7 @@ msgid "Authentication backend name missing" msgstr "Nome del Backend di autenticazione non specificato" #: /usr/share/icingaweb2/application/forms/Config/AuthenticationBackendReorderForm.php:54 -msgid "Authentication order updated!" +msgid "Authentication order updated" msgstr "Ordine di autenticazione aggiornato!" #: /usr/share/icingaweb2/application/forms/AutoRefreshForm.php:44 diff --git a/application/locale/pt_BR/LC_MESSAGES/icinga.po b/application/locale/pt_BR/LC_MESSAGES/icinga.po index 01dc18a9f..ba35c265e 100644 --- a/application/locale/pt_BR/LC_MESSAGES/icinga.po +++ b/application/locale/pt_BR/LC_MESSAGES/icinga.po @@ -130,7 +130,7 @@ msgid "Authentication backend name missing" msgstr "Falta o nome do backend de autenticação" #: /usr/local/icingaweb/application/forms/Config/AuthenticationBackendReorderForm.php:55 -msgid "Authentication order updated!" +msgid "Authentication order updated" msgstr "Ordem da autenticação atualizada!" #: /usr/local/icingaweb/application/forms/Config/AuthenticationBackendConfigForm.php:307 From 9917e63e020991bfc3895fb954968efc610a0f31 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 27 Apr 2015 13:16:54 +0200 Subject: [PATCH 3/6] Remove exclamation mark from the notification "Authentication order updated!"'s translations --- application/locale/it_IT/LC_MESSAGES/icinga.po | 2 +- application/locale/pt_BR/LC_MESSAGES/icinga.po | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/locale/it_IT/LC_MESSAGES/icinga.po b/application/locale/it_IT/LC_MESSAGES/icinga.po index c61195216..73d616bfa 100644 --- a/application/locale/it_IT/LC_MESSAGES/icinga.po +++ b/application/locale/it_IT/LC_MESSAGES/icinga.po @@ -200,7 +200,7 @@ msgstr "Nome del Backend di autenticazione non specificato" #: /usr/share/icingaweb2/application/forms/Config/AuthenticationBackendReorderForm.php:54 msgid "Authentication order updated" -msgstr "Ordine di autenticazione aggiornato!" +msgstr "Ordine di autenticazione aggiornato" #: /usr/share/icingaweb2/application/forms/AutoRefreshForm.php:44 msgid "Auto refresh successfully disabled" diff --git a/application/locale/pt_BR/LC_MESSAGES/icinga.po b/application/locale/pt_BR/LC_MESSAGES/icinga.po index ba35c265e..16aba2378 100644 --- a/application/locale/pt_BR/LC_MESSAGES/icinga.po +++ b/application/locale/pt_BR/LC_MESSAGES/icinga.po @@ -131,7 +131,7 @@ msgstr "Falta o nome do backend de autenticação" #: /usr/local/icingaweb/application/forms/Config/AuthenticationBackendReorderForm.php:55 msgid "Authentication order updated" -msgstr "Ordem da autenticação atualizada!" +msgstr "Ordem da autenticação atualizada" #: /usr/local/icingaweb/application/forms/Config/AuthenticationBackendConfigForm.php:307 msgid "Autologin" From f3ca80ffced18497322a74b8b49e94e88bb31cdc Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 27 Apr 2015 14:44:19 +0200 Subject: [PATCH 4/6] Don't fetchAll() and loop afterwards in the alert summary report refs #8340 --- .../application/controllers/AlertsummaryController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index dcc805286..5b4e2e3fa 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -274,7 +274,6 @@ class Monitoring_AlertsummaryController extends Controller ); $defects = array(); - $records = $query->getQuery()->fetchAll(); $period = $this->createPeriod($interval); foreach ($period as $entry) { @@ -282,7 +281,7 @@ class Monitoring_AlertsummaryController extends Controller $defects[$id] = array($id, 0); } - foreach ($records as $item) { + foreach ($query as $item) { $id = $this->getPeriodFormat($interval, $item->timestamp); if (empty($defects[$id])) { $defects[$id] = array($id, 0); From d27b94dcecdd18b59912c851234b80fdd5d93cec Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 28 Apr 2015 12:52:59 +0200 Subject: [PATCH 5/6] Revert "Don't fetchAll() and loop afterwards in the alert summary report" This reverts commit f3ca80ffced18497322a74b8b49e94e88bb31cdc. --- .../application/controllers/AlertsummaryController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index 5b4e2e3fa..dcc805286 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -274,6 +274,7 @@ class Monitoring_AlertsummaryController extends Controller ); $defects = array(); + $records = $query->getQuery()->fetchAll(); $period = $this->createPeriod($interval); foreach ($period as $entry) { @@ -281,7 +282,7 @@ class Monitoring_AlertsummaryController extends Controller $defects[$id] = array($id, 0); } - foreach ($query as $item) { + foreach ($records as $item) { $id = $this->getPeriodFormat($interval, $item->timestamp); if (empty($defects[$id])) { $defects[$id] = array($id, 0); From 034421d0cba6fcf117445e04746663b8e50fc5ed Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 30 Apr 2015 15:20:19 +0200 Subject: [PATCH 6/6] Fix form tests utilizing Mockery's partial mock functionality Since an update of Mockery, partial mocks do not call the constructor of their mocked classes anymore without explicitly passing a non empty array. This is a regression of the following bug: https://github.com/padraic/mockery/issues/144 --- .../forms/Config/Authentication/DbBackendFormTest.php | 6 ++++-- .../forms/Config/Authentication/LdapBackendFormTest.php | 6 ++++-- .../forms/Config/Resource/LdapResourceFormTest.php | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/php/application/forms/Config/Authentication/DbBackendFormTest.php b/test/php/application/forms/Config/Authentication/DbBackendFormTest.php index b7d1ea3c1..fb93f6050 100644 --- a/test/php/application/forms/Config/Authentication/DbBackendFormTest.php +++ b/test/php/application/forms/Config/Authentication/DbBackendFormTest.php @@ -31,7 +31,8 @@ class DbBackendFormTest extends BaseTestCase ->shouldReceive('count') ->andReturn(2); - $form = Mockery::mock('Icinga\Forms\Config\Authentication\DbBackendForm[getView]'); + // Passing array(null) is required to make Mockery call the constructor... + $form = Mockery::mock('Icinga\Forms\Config\Authentication\DbBackendForm[getView]', array(null)); $form->shouldReceive('getView->escape') ->with(Mockery::type('string')) ->andReturnUsing(function ($s) { return $s; }); @@ -56,7 +57,8 @@ class DbBackendFormTest extends BaseTestCase ->shouldReceive('count') ->andReturn(0); - $form = Mockery::mock('Icinga\Forms\Config\Authentication\DbBackendForm[getView]'); + // Passing array(null) is required to make Mockery call the constructor... + $form = Mockery::mock('Icinga\Forms\Config\Authentication\DbBackendForm[getView]', array(null)); $form->shouldReceive('getView->escape') ->with(Mockery::type('string')) ->andReturnUsing(function ($s) { return $s; }); diff --git a/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php b/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php index d31033ba9..56ea08987 100644 --- a/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php +++ b/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php @@ -31,7 +31,8 @@ class LdapBackendFormTest extends BaseTestCase Mockery::mock('overload:Icinga\Authentication\Backend\LdapUserBackend') ->shouldReceive('assertAuthenticationPossible')->andReturnNull(); - $form = Mockery::mock('Icinga\Forms\Config\Authentication\LdapBackendForm[getView]'); + // Passing array(null) is required to make Mockery call the constructor... + $form = Mockery::mock('Icinga\Forms\Config\Authentication\LdapBackendForm[getView]', array(null)); $form->shouldReceive('getView->escape') ->with(Mockery::type('string')) ->andReturnUsing(function ($s) { return $s; }); @@ -55,7 +56,8 @@ class LdapBackendFormTest extends BaseTestCase Mockery::mock('overload:Icinga\Authentication\Backend\LdapUserBackend') ->shouldReceive('assertAuthenticationPossible')->andThrow(new AuthenticationException); - $form = Mockery::mock('Icinga\Forms\Config\Authentication\LdapBackendForm[getView]'); + // Passing array(null) is required to make Mockery call the constructor... + $form = Mockery::mock('Icinga\Forms\Config\Authentication\LdapBackendForm[getView]', array(null)); $form->shouldReceive('getView->escape') ->with(Mockery::type('string')) ->andReturnUsing(function ($s) { return $s; }); diff --git a/test/php/application/forms/Config/Resource/LdapResourceFormTest.php b/test/php/application/forms/Config/Resource/LdapResourceFormTest.php index d074f1b3b..f382f8bb8 100644 --- a/test/php/application/forms/Config/Resource/LdapResourceFormTest.php +++ b/test/php/application/forms/Config/Resource/LdapResourceFormTest.php @@ -29,7 +29,8 @@ class LdapResourceFormTest extends BaseTestCase Mockery::mock()->shouldReceive('testCredentials')->once()->andReturn(true)->getMock() ); - $form = Mockery::mock('Icinga\Forms\Config\Resource\LdapResourceForm[getView]'); + // Passing array(null) is required to make Mockery call the constructor... + $form = Mockery::mock('Icinga\Forms\Config\Resource\LdapResourceForm[getView]', array(null)); $form->shouldReceive('getView->escape') ->with(Mockery::type('string')) ->andReturnUsing(function ($s) { return $s; }); @@ -51,7 +52,8 @@ class LdapResourceFormTest extends BaseTestCase Mockery::mock()->shouldReceive('testCredentials')->once()->andThrow('\Exception')->getMock() ); - $form = Mockery::mock('Icinga\Forms\Config\Resource\LdapResourceForm[getView]'); + // Passing array(null) is required to make Mockery call the constructor... + $form = Mockery::mock('Icinga\Forms\Config\Resource\LdapResourceForm[getView]', array(null)); $form->shouldReceive('getView->escape') ->with(Mockery::type('string')) ->andReturnUsing(function ($s) { return $s; });