diff --git a/debian/changelog b/debian/changelog index 755bef2a..ad8892e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.30.1) stable; urgency=low +hedera-web (23.30.2) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index e982d0b0..d8689b05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.30.1", + "version": "23.30.2", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/core/query.php b/rest/core/query.php index 4d398e93..cbd056dd 100644 --- a/rest/core/query.php +++ b/rest/core/query.php @@ -1,6 +1,7 @@ moreResults() && $db->nextResult()); if ($db->checkWarnings() - &&($result = $db->query('SHOW WARNINGS'))) { - $sql = 'SELECT `description`, @warn `code` - FROM `message` WHERE `code` = @warn'; + && ($result = $db->query('SHOW WARNINGS'))) { + $sql = + 'SELECT IFNULL(i.`description`, m.`description`) `description`, @warn `code` + FROM `message` m + LEFT JOIN `messageI18n` i + ON i.`code` = m.`code` AND i.lang = # + WHERE m.`code` = @warn'; while ($row = $result->fetch_object()) { if ($row->Code == 1265 - &&($warning = $db->getObject($sql))) + && ($warning = $db->getObject($sql, [Locale::get()]))) trigger_error("{$warning->code}: {$warning->description}", E_USER_WARNING); else trigger_error("{$row->Code}: {$row->Message}", E_USER_WARNING); diff --git a/web/rest-service.php b/web/rest-service.php index ded4fd94..bb10717c 100644 --- a/web/rest-service.php +++ b/web/rest-service.php @@ -54,8 +54,12 @@ class RestService extends Service { if ($e->getCode() == 1644) { $eMessage = $e->getMessage(); $tMessage = $db->getValue( - 'SELECT `description` FROM `messageL10n` WHERE `code` = #', - [$eMessage] + 'SELECT IFNULL(i.`description`, m.`description`) `description` + FROM `message` m + LEFT JOIN `messageI18n` i + ON i.`code` = m.`code` AND i.lang = # + WHERE m.`code` = #', + [Locale::get(), $eMessage] ); if (!$tMessage) $tMessage = $eMessage; throw new Lib\UserException($tMessage, $eMessage);