silverstripe/silverstripe-translatable — pull request #39 by tractorcow (2012-08-09 04:13:59+00:00)
Title: FIXED: Error where uninitialised Locale field would crash queries.

Fixed an error where uninitialised Locale field would crash queries. This is noticeable during full text search, when full model fields might not be initialised.

I had setup a full text search form for my blog, and as full text search works, only sitetree default fields are returned, meaning some fields (e.g. Locale) can not be guaranteed to load. The error received:

```
Error retrieved: "ERROR [Notice]: Undefined property: BlogEntry::$Locale"
```

I simply substituted in an !empty() in the augmentSQL() function to safely check for existence of a Locale value instead of simply calling the field directly.