Re: [sagentic] User Account Creation Error
Ok, I've fixed that for the next version. Here's the fix:
- Open /lib/menus/default/save.php
- Search for: isIntColumn
- Replace this code block:
// save blank int column values as null
$columnType = @$mySqlColsAndTypes[$colName];
$isIntColumn = preg_match("/^(tinyint|smallint|mediumint|int|bigint)/i", $columnType);
if ($value == '' && $isIntColumn && $fieldType != 'checkbox') {
$colsToValuesString .= "`$colName` = NULL, ";
}
With this one (new code in red):
// save blank int column values as null
$columnType = @$mySqlColsAndTypes[$colName];
$fieldType = @$schema[$colName]['type'];
$isIntColumn = preg_match("/^(tinyint|smallint|mediumint|int|bigint)/i", $columnType);
if ($value == '' && $isIntColumn && $fieldType != 'checkbox') {
$colsToValuesString .= "`$colName` = NULL, ";
}
>why is it happening?
It's a bug (thanks for reporting it!), and since you asked... :) Here's the technical details:
We added support for custom mysql column types (INT, etc) in the field editor a while back. The problem with that is those field only support a number or null, there is no "blank". So people saving a record with no value for a integer field would modify it and see a zero the next time. So we added some code to save integers as null if they have no value. Except checkboxes are store as tinyint's (as 0 or 1) but don't support NULLs, so the above code adds an exception for checkboxes.
Hope that helps, let me know if that patch fixes the problem or if there are any other issues.
Dave Edis - Senior Developer
interactivetools.com