From 48d3d9ca49c1f4bde14b02d721bbe89a4acc6170 Mon Sep 17 00:00:00 2001 From: Jono Menz Date: Mon, 14 Oct 2019 12:58:52 -0700 Subject: [PATCH] DOCS Note inability to filter on null --- .../02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md b/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md index 57f9b61a0..49438ad84 100644 --- a/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md +++ b/docs/en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md @@ -321,6 +321,14 @@ exact match. 'FirstName:StartsWith' => 'S' 'PlayerNumber:GreaterThan' => '10' )); + +
+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\" = ''"); + +
### filterAny