Don't cast data when saving in the edit grid, so errors are seen and data doesn't get silently modified. Fixes #1994
parent
81841cdb3c
commit
b8d03d5dc2
|
@ -1980,8 +1980,6 @@ define(
|
||||||
')';
|
')';
|
||||||
}
|
}
|
||||||
|
|
||||||
column_label = c.display_name + '<br>' + col_type;
|
|
||||||
|
|
||||||
// Identify cell type of column.
|
// Identify cell type of column.
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "json":
|
case "json":
|
||||||
|
@ -2002,10 +2000,22 @@ define(
|
||||||
case "boolean":
|
case "boolean":
|
||||||
col_cell = 'boolean';
|
col_cell = 'boolean';
|
||||||
break;
|
break;
|
||||||
|
case "character":
|
||||||
|
case "character[]":
|
||||||
|
case "character varying":
|
||||||
|
case "character varying[]":
|
||||||
|
if (c.internal_size && c.internal_size != 65535) {
|
||||||
|
// Update column type to display length on column header
|
||||||
|
col_type += ' (' + c.internal_size + ')';
|
||||||
|
}
|
||||||
|
col_cell = 'string';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
col_cell = 'string';
|
col_cell = 'string';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
column_label = c.display_name + '<br>' + col_type;
|
||||||
|
|
||||||
var col = {
|
var col = {
|
||||||
'name': c.name,
|
'name': c.name,
|
||||||
'label': column_label,
|
'label': column_label,
|
||||||
|
|
|
@ -12,5 +12,5 @@ INSERT INTO {{ conn|qtIdent(nsp_name, object_name) }} (
|
||||||
{% set col_value = data_to_be_saved[col]|qtLiteral %}
|
{% set col_value = data_to_be_saved[col]|qtLiteral %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{########################################################}
|
{########################################################}
|
||||||
{% if not loop.first %}, {% endif %}{{ col_value }}::{{data_type[col]}}{% endfor %}
|
{% if not loop.first %}, {% endif %}{{ col_value }}{% endfor %}
|
||||||
);
|
);
|
|
@ -9,7 +9,7 @@ UPDATE {{ conn|qtIdent(nsp_name, object_name) }} SET
|
||||||
{% set col_value = data_to_be_saved[col]|qtLiteral %}
|
{% set col_value = data_to_be_saved[col]|qtLiteral %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{########################################################}
|
{########################################################}
|
||||||
{% if not loop.first %}, {% endif %}{{ conn|qtIdent(col) }} = {{ col_value }}::{{data_type[col]}}{% endfor %}
|
{% if not loop.first %}, {% endif %}{{ conn|qtIdent(col) }} = {{ col_value }}{% endfor %}
|
||||||
WHERE
|
WHERE
|
||||||
{% for pk in primary_keys %}
|
{% for pk in primary_keys %}
|
||||||
{% if not loop.first %} AND {% endif %}{{ conn|qtIdent(pk) }} = {{ primary_keys[pk]|qtLiteral }}{% endfor %};
|
{% if not loop.first %} AND {% endif %}{{ conn|qtIdent(pk) }} = {{ primary_keys[pk]|qtLiteral }}{% endfor %};
|
Loading…
Reference in New Issue