[Vtigercrm-commits] [vtiger development] #7177: Conflict empty versus null
vtiger development
vtiger-tickets at trac.vtiger.com
Sat Oct 22 07:42:40 PDT 2011
#7177: Conflict empty versus null
------------------------+---------------------------------------------------
Reporter: lucvanhove | Owner: developer
Type: defect | Status: new
Priority: unassigned | Milestone: Unassigned
Component: vtigercrm | Version: 5.2.1
Severity: Medium | Keywords:
------------------------+---------------------------------------------------
Vtiger allows an empty string to be stored in de database but one cannot
filter on an empty string. (ref listview) The filter converts an emty
string value to null so one never will get a match with what is stored in
the database.
In my specific situation i have added for contacts a multiselect field
"bookfair" (uitype=33) which is optional. When i save a contact without
selecting an option from this field an empty string is stored in the
database.
When i make a filter to list all contacts that do not have a bookfair set
i get also those that did not select an option.
The solution for my specific problem:
in data/CRMEntity.php in function insertIntoEntityTable() near line 519:
{{{
Replace:
$fldvalue = $field_list;
With:
// 2011-10-22 hovel If field is empty set it to null
if ($field_list == '') {
$fldvalue = null;
}
else {
$fldvalue = $field_list;
}
}}}
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7177>
vtiger development <http://trac.vtiger.com/>
vtigerCRM
More information about the vtigercrm-commits
mailing list