Fix: _dbFetchRow → _dbFetchOne integraatio-funktioissa
_dbFetchRow-funktiota ei ole olemassa, oikea nimi on _dbFetchOne. Tämä aiheutti Fatal errorin kaikissa integraatio-operaatioissa, minkä vuoksi integraatiot eivät tallentuneet tietokantaan. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
8
db.php
8
db.php
@@ -2245,7 +2245,7 @@ function dbLoadIntegrations(string $companyId): array {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dbGetIntegration(string $companyId, string $type): ?array {
|
function dbGetIntegration(string $companyId, string $type): ?array {
|
||||||
$row = _dbFetchRow("SELECT * FROM integrations WHERE company_id = ? AND type = ?", [$companyId, $type]);
|
$row = _dbFetchOne("SELECT * FROM integrations WHERE company_id = ? AND type = ?", [$companyId, $type]);
|
||||||
if ($row && $row['config']) {
|
if ($row && $row['config']) {
|
||||||
$row['config'] = json_decode($row['config'], true) ?: [];
|
$row['config'] = json_decode($row['config'], true) ?: [];
|
||||||
}
|
}
|
||||||
@@ -2253,7 +2253,7 @@ function dbGetIntegration(string $companyId, string $type): ?array {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dbSaveIntegration(string $companyId, string $type, bool $enabled, array $config): void {
|
function dbSaveIntegration(string $companyId, string $type, bool $enabled, array $config): void {
|
||||||
$existing = _dbFetchRow("SELECT id FROM integrations WHERE company_id = ? AND type = ?", [$companyId, $type]);
|
$existing = _dbFetchOne("SELECT id FROM integrations WHERE company_id = ? AND type = ?", [$companyId, $type]);
|
||||||
$now = date('Y-m-d H:i:s');
|
$now = date('Y-m-d H:i:s');
|
||||||
if ($existing) {
|
if ($existing) {
|
||||||
_dbExecute(
|
_dbExecute(
|
||||||
@@ -2270,9 +2270,9 @@ function dbSaveIntegration(string $companyId, string $type, bool $enabled, array
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dbGetTicketByZammadId(string $companyId, int $zammadId): ?array {
|
function dbGetTicketByZammadId(string $companyId, int $zammadId): ?array {
|
||||||
return _dbFetchRow("SELECT * FROM tickets WHERE company_id = ? AND zammad_ticket_id = ?", [$companyId, $zammadId]);
|
return _dbFetchOne("SELECT * FROM tickets WHERE company_id = ? AND zammad_ticket_id = ?", [$companyId, $zammadId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbGetMessageByZammadArticleId(string $ticketId, int $articleId): ?array {
|
function dbGetMessageByZammadArticleId(string $ticketId, int $articleId): ?array {
|
||||||
return _dbFetchRow("SELECT * FROM ticket_messages WHERE ticket_id = ? AND zammad_article_id = ?", [$ticketId, $articleId]);
|
return _dbFetchOne("SELECT * FROM ticket_messages WHERE ticket_id = ? AND zammad_article_id = ?", [$ticketId, $articleId]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user