Closed nerimic closed 4 years ago
I have investigated about this issue and probably it is the same of #10090 I will not give the fix because it is not clear to me.
step by step
Vtiger_ListView_Model::getListViewEntries()
calls $this->getQueryGenerator()->createQuery()
createQuery()
calls $this->loadWhere()
loadWhere()
calls $this->parseConditions($this->conditions)
parseConditions()
calls $this->getCondition($fieldName, $rule['value'], $rule['operator'])
getConditions()
calls $queryField->getCondition()
[$queryField = $this->getQueryField($fieldName)
]App\QueryField\DateField
] getCondition()
calls relative operator function: operatorE, operatorC ans so on.public function getValue()
{
return \DateTimeField::convertToDBFormat($this->value);
}
at this point
convertToDBFormat()
calls __convertToDBFormat($date, $format)
where $format is user preferred date format__convertToDBFormat()
calls list($y, $m, $d) = App\Fields\Date::explode($date, $format)
explode($date, $format)
receives date in db format [yyyy-mm-dd] and $format is user preferred date format: explode() returns a mystified date. eg: if user preferred date format is dd-mm-yyyy and the date into database (condition value) is 2019-07-14, the returned value will be 14-07-2019. Query returns empty record set. The condition value is already into querying correct format: it has not to be formatted.PS: if the problem is into App\QueryField\DateField getValue(), maybe (maybe) there could be similar problems for App\QueryField\DatetimeField, App\QueryField\TimeField, App\QueryField\CurrencyField
Error was fixed
🔥 How to trigger the error
Steps to reproduce the behavior:
👎 Actual Behavior
No data to display.
👍 Expected Behavior
Elements in list.