BUGFIX Properly identify the foreign class in a many many relationship when building the schema

The first item in the array returned by DataObject#many_many is the parent class, not the foreign class, so we need to retrieve the second item of that list.
This commit is contained in:
Jean-Fabien Barrois 2014-07-23 13:46:10 +12:00
parent 9629f0e0f5
commit 131a7d5ebc
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ abstract class SearchIndex extends ViewableData {
);
}
else if ($manyMany = $singleton->many_many($lookup)) {
$class = $manyMany[0];
$class = $manyMany[1];
$options['multi_valued'] = true;
$options['lookup_chain'][] = array(
'call' => 'method', 'method' => $lookup,