silverstripe-big-o/sapphire — comment on commit bb6d4c506edab578baf3e5427b8cea584022c7b4
File:  line 0
By sminnee:

Agree that the bugfix here neededed to be made, and this code isn't *wrong*, but a few things concern me:

* There is an enormous difference in behaviour between ID = 0 and ID = null. I predict future bugs. ;-)
* The foreign key isn't really 0, it needs to be set to something as yet undefined.
* I'm not sure that there is any need to query on a ManyManyList that has foreignID = null. Such a list should be unable to return records. It should either return nothing at all, or throw an exception.

This is fine to go into master, but we might want to tweak it further. I'll raise a ticket on open.ss.org