From ecf175728f987aa2c9a0d56ef0c7ba38783f2222 Mon Sep 17 00:00:00 2001 From: Gemini Date: Tue, 30 Jun 2026 14:58:52 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20compat=20GLPI=2011.0.4=20=E2=80=94=20tro?= =?UTF-8?q?ca=20Toolbox::logError=20por=20logInFile=20(1.5.2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Toolbox::logError não existe no 11.0.4 -> erro fatal ao criar issue/lançar tempo/garantir membership. Usa Toolbox::logInFile('redmine', ...). Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 8 ++++++++ docs/API.md | 2 +- inc/redmineapi.class.php | 4 ++-- setup.php | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 538589e..960af12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ Todas as mudanças relevantes deste plugin são documentadas aqui. O formato segue [Keep a Changelog](https://keepachangelog.com/pt-BR/1.0.0/) e o versionamento segue [SemVer](https://semver.org/lang/pt-BR/). +## [1.5.2] + +### Corrigido +- Compatibilidade com GLPI 11.0.4: `Toolbox::logError()` não existe nessa versão e + causava erro fatal (`undefined method logError`) ao criar issue / lançar tempo / + garantir membership. Substituído por `Toolbox::logInFile('redmine', ...)`, disponível + em todas as versões. + ## [1.5.1] ### Corrigido diff --git a/docs/API.md b/docs/API.md index f008343..d0b90e8 100644 --- a/docs/API.md +++ b/docs/API.md @@ -183,7 +183,7 @@ Editar horas de uma task já lançada **não** re-sincroniza. Reverter `Feito` aviso em `files/_log/redmine*`. - **API inacessível / chave inválida:** `syncMetadata()` retorna `false`; criação de issue/tempo é abortada com log. -- Todo erro HTTP `>= 400` é logado via `Toolbox::logError`. +- Todo erro HTTP `>= 400` é logado via `Toolbox::logInFile('redmine', ...)` (em `files/_log/redmine*`). --- diff --git a/inc/redmineapi.class.php b/inc/redmineapi.class.php index 9569fc1..c8a7653 100644 --- a/inc/redmineapi.class.php +++ b/inc/redmineapi.class.php @@ -32,7 +32,7 @@ class PluginRedmineRedmineapi { private static function post($endpoint, $payload, $switchUser = null) { $config = self::getConfig(); if (!$config || empty($config['redmine_url']) || empty($config['api_key'])) { - Toolbox::logError("Redmine Plugin: URL or API Key not configured."); + Toolbox::logInFile('redmine', "URL ou chave de API não configurada.\n"); return false; } @@ -61,7 +61,7 @@ class PluginRedmineRedmineapi { if ($httpcode >= 200 && $httpcode < 300) { return json_decode($response, true); } else { - Toolbox::logError("Redmine Plugin API Error: [$httpcode] $response"); + Toolbox::logInFile('redmine', "API Error: [$httpcode] $response\n"); return false; } } diff --git a/setup.php b/setup.php index de8127d..4a6ae17 100644 --- a/setup.php +++ b/setup.php @@ -1,6 +1,6 @@