Commit 4746344b authored by Carsten  Rose's avatar Carsten Rose

Extend error message when missing subrecord column id

parent 52c24ff8
Pipeline #3168 passed with stages
in 2 minutes and 4 seconds
......@@ -7854,7 +7854,8 @@ Example::
"maxTime": "20:00:00",
"businessHours": { "dow": [ 1, 2, 3, 4 ], "startTime": "10:00", "endTime": "18:00" },
"events": [
{ "id": "a", "title": "my event", "start": "2020-01-21"},
{ "id": "a", "title": "my event",
"start": "2020-01-21"},
{ "id": "b", "title": "my other event", "start": "2020-01-16T09:00:00", "end": "2020-01-16T11:30:00"}
]}'>
</div>
......
......@@ -2242,7 +2242,7 @@ abstract class AbstractBuildForm {
}
if (!is_array($formElement[FE_SQL1])) {
throw new \UserFormException('Missing \'sql1\' Query', ERROR_MISSING_SQL1);
throw new \UserFormException('Missing \'sql1\' query', ERROR_MISSING_SQL1);
}
// No records?
......@@ -2258,14 +2258,12 @@ abstract class AbstractBuildForm {
$nameColumnId = '_id';
if (!isset($formElement[FE_SQL1][0][$nameColumnId])) {
throw new \UserFormException('Missing column \'id\' or \'_id\' in subrecord query', ERROR_SUBRECORD_MISSING_COLUMN_ID);
throw new \UserFormException(
json_encode([ERROR_MESSAGE_TO_USER => "Missing column [_]$nameColumnId in subrecord query", ERROR_MESSAGE_TO_DEVELOPER => $this->$formElement[FE_SQL1]]),
ERROR_SUBRECORD_MISSING_COLUMN_ID);
}
}
if (!isset($formElement[FE_SQL1][0][$nameColumnId])) {
throw new \UserFormException('Missing column \'id\' (or "_id") in \'sql1\' Query', ERROR_DB_MISSING_COLUMN_ID);
}
return true;
}
......
......@@ -325,7 +325,7 @@ const ERROR_DB_CLOSE_MYSQLI_RESULT = 2009;
const ERROR_DB_CLOSE_MYSQLI_STMT = 2010;
const ERROR_DB_UNKNOWN_COLUMN = 2011;
const ERROR_DB_UNKNOWN_COMMAND = 2012;
const ERROR_DB_MISSING_COLUMN_ID = 2013;
const ERROR_DB_COLUMN_NOT_FOUND_IN_TABLE = 2014;
const ERROR_DB_SET_CHARSET = 2015;
const ERROR_DB_MULTI_QUERY_FAILED = 2016;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment