mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
38efb79e6f
commit
6104d33f9d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user