I'm trying to add a source on a custom element type that shows entries with an empty assigned_user_id
field. This criteria is not honored and returns the same results as the "All Entries" source. Is there any way to specify a null or empty string criteria value?
public function getSources($context = null)
{
$sources = [
'*' => [
'label' => Craft::t('All Entries'),
'defaultSort' => [
'test_plugin.dateCreated',
'desc'
]
]
];
$sources[] = ['heading' => 'Assignments'];
$sources['unassigned'] = [
'label' => Craft::t('Unassigned'),
'criteria' => ['assigned_user_id' => '']
];
return $sources;
}
assigned_user_id
a Craft relation or just a simple integer?