Merge pull request #9286 from jonom/patch-2

DOCS Note inability to filter on null
This commit is contained in:
Loz Calver 2019-10-15 09:39:01 +01:00 committed by GitHub
commit 1d63cf50da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -321,6 +321,14 @@ exact match.
'FirstName:StartsWith' => 'S'
'PlayerNumber:GreaterThan' => '10'
));
<div class="notice" markdown='1'>
Please note that in SilverStripe 3.x it's not possible to filter a list based on a field containing a `null` value (see [this issue](https://github.com/silverstripe/silverstripe-framework/issues/3621) for context). You can workaround this with a `where` statement, for example:
:::php
$unsponsoredPlayers = Player::get()->where("\"MainSponsor\" IS NULL OR \"MainSponsor\" = ''");
</div>
### filterAny