datasources icon indicating copy to clipboard operation
datasources copied to clipboard

ArraySource: Find with empty field condition returns all records

Open liviakuenzli opened this issue 8 years ago • 0 comments

Situation: An array-based countries table with no record with country_iso_3_code being empty.

$result = $countryModel->find('list',
	array(
		'conditions' => array('country_iso_3_code' => ''),
	)
);

Expected $result to be empty, but it holds all entries of the table.

The following line is probably the culprint: https://github.com/cakephp/datasources/blob/47c4672cbd8902ef57557d50dd772368863596a8/Model/Datasource/ArraySource.php#L253

liviakuenzli avatar Feb 22 '17 15:02 liviakuenzli