silverstripe/silverstripe-translatable — pull request #129 by jthomerson (2013-07-31 18:24:58+00:00)
Title: FIX: get_one_by_locale didn't work when filter disabled

Must explicitly filter by locale in case the locale filter is disabled.

Locale filter could also fail in other cases besides just being disabled. For instance, if the $filter var that the user passed in contains the string 'Locale = ' then the regex used by Translatable to determine if the query is already filtering on locale could have a false positive (for instance, if the string above was actually in a subquery or even in a constant value). Thus, filtering explicitly by locale is better all around.