BUGFIX Fixed incorrect hasDatabaseField() in SearchFilter::getDbName() - use hasOwnTableDatabaseField() instead

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@93860 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-11-27 06:22:26 +00:00 committed by Sam Minnee
parent 38efb79e6f
commit 6104d33f9d

View File

@ -128,7 +128,7 @@ abstract class SearchFilter extends Object {
// Todo: move to somewhere more appropriate, such as DataMapper, the magical class-to-be?
$candidateClass = $this->model;
while($candidateClass != 'DataObject') {
if(singleton($candidateClass)->hasDatabaseField($this->name)) break;
if(singleton($candidateClass)->hasOwnTableDatabaseField($this->name)) break;
$candidateClass = get_parent_class($candidateClass);
}
if($candidateClass == 'DataObject') user_error("Couldn't find field $this->name in any of $this->model's tables.", E_USER_ERROR);