[Vtigercrm-commits] [Vtiger development] #7177: Conflict empty versus null
Vtiger development
vtiger-tickets at trac.vtiger.com
Tue Sep 1 07:43:35 GMT 2015
#7177: Conflict empty versus null
------------------------+---------------------
Reporter: lucvanhove | Owner: manu
Type: defect | Status: closed
Priority: unassigned | Milestone: 6.4.0
Component: vtigercrm | Version: 5.2.1
Severity: Medium | Resolution: fixed
Keywords: |
------------------------+---------------------
Changes (by prasad):
* status: assigned => closed
* resolution: => fixed
Old description:
> 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;
> }
> }}}
New description:
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;
}
}}}
--
Comment:
Changeset [14517]
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7177#comment:3>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM
More information about the vtigercrm-commits
mailing list