forked from verdnatura/hedera-web
Merge branch 'master' into hotFix_correctOrder_logout
This commit is contained in:
commit
f929e67d76
|
@ -1,4 +1,4 @@
|
|||
hedera-web (23.30.1) stable; urgency=low
|
||||
hedera-web (23.30.2) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hedera-web",
|
||||
"version": "23.30.1",
|
||||
"version": "23.30.2",
|
||||
"description": "Verdnatura web page",
|
||||
"license": "GPL-3.0",
|
||||
"repository": {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue