0
1
Fork 0

Merge branch 'master' into hotFix_correctOrder_logout

This commit is contained in:
Juan Ferrer 2023-07-28 11:24:56 +00:00
commit f929e67d76
4 changed files with 17 additions and 8 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (23.30.1) stable; urgency=low
hedera-web (23.30.2) stable; urgency=low
* Initial Release.

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "23.30.1",
"version": "23.30.2",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {

View File

@ -1,6 +1,7 @@
<?php
use Vn\Lib;
use Vn\Lib\Locale;
use Vn\Web\Security;
use Vn\Lib\Type;
@ -37,12 +38,16 @@ class Query extends Vn\Web\JsonRequest {
if ($db->checkWarnings()
&& ($result = $db->query('SHOW WARNINGS'))) {
$sql = 'SELECT `description`, @warn `code`
FROM `message` WHERE `code` = @warn';
$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);

View File

@ -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);