Created
May 7, 2023 11:19
-
-
Save ioxorg/36ffd421ad3099e138af1e75853f5418 to your computer and use it in GitHub Desktop.
ugly CLocalApiCLient.php patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php.orig 2023-03-08 16:23:26.555055621 +0100 | |
+++ /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php 2023-03-08 16:22:46.378217849 +0100 | |
@@ -128,6 +128,13 @@ | |
$newTransaction = true; | |
} | |
+ // UGLY GRAFANA DATASOURCE HACK | |
+ // rename "user" param to "username" when present | |
+ if ($params['user'] ?? null) { | |
+ $params['username'] = $params['user']; | |
+ unset($params['user']); | |
+ } | |
+ | |
$result = call_user_func_array([$this->serviceFactory->getObject($api), $method], [$params]); | |
// if the method was called successfully - commit the transaction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment