From 6ab5969ac1f22e2c68802e73a69c1fb5e0f16c3e Mon Sep 17 00:00:00 2001 From: Daniel Pickering Date: Wed, 25 Jun 2014 14:21:57 +1200 Subject: [PATCH] Fix many_many fieldData bug This fixes a critical bug meaning that using many_many fields in full text searching would have always failed. the $singleton->many_many() lookup returns an array() of many-many components, however the line $class = $manyMany[0] is wrong, as the first value of the array is always the $dataClass (parentClass), not the otherClass (childClass). Changing this to $class = $manyMany[1] fixes this bug. --- code/search/SearchIndex.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/search/SearchIndex.php b/code/search/SearchIndex.php index 2e411b0..2c650ef 100644 --- a/code/search/SearchIndex.php +++ b/code/search/SearchIndex.php @@ -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,