mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
Merge pull request #14 from silverstripe-big-o/pull/instance-of-sslist
BUG Check for instanceof SS_List rather than deprecated DataObjectSet
This commit is contained in:
commit
5036f9e93c
@ -366,8 +366,8 @@ abstract class SearchIndex extends ViewableData {
|
|||||||
// Just fail if we've fallen off the end of the chain
|
// Just fail if we've fallen off the end of the chain
|
||||||
if (!$object) return null;
|
if (!$object) return null;
|
||||||
|
|
||||||
// If we're looking up this step on an array or DataObjectSet, do the step on every item, merge result
|
// If we're looking up this step on an array or SS_List, do the step on every item, merge result
|
||||||
if (is_array($object) || $object instanceof DataObjectSet) {
|
if (is_array($object) || $object instanceof SS_List) {
|
||||||
$next = array();
|
$next = array();
|
||||||
|
|
||||||
foreach ($object as $item) {
|
foreach ($object as $item) {
|
||||||
@ -380,7 +380,7 @@ abstract class SearchIndex extends ViewableData {
|
|||||||
$item = $item->$property;
|
$item = $item->$property;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item instanceof DataObjectSet) $next = array_merge($next, $item->toArray());
|
if ($item instanceof SS_List) $next = array_merge($next, $item->toArray());
|
||||||
elseif (is_array($item)) $next = array_merge($next, $item);
|
elseif (is_array($item)) $next = array_merge($next, $item);
|
||||||
else $next[] = $item;
|
else $next[] = $item;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user