MDL-60357 search: Ensure that the document is valid
commit0049244893d5b602c9c0d1c125d3cd21583b8c26
authorAndrew Nicols <andrew@nicols.co.uk>
Fri, 13 Oct 2017 01:41:57 +0000 (13 09:41 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Fri, 13 Oct 2017 01:41:59 +0000 (13 09:41 +0800)
treebca7d84ec6b46f7a7ee33e73e2d15cccc634da97
parent131e60741a988e3067230ff3b9d8f2f7a374550f
MDL-60357 search: Ensure that the document is valid

We were previously testing tha the parent is valid, which it was, and
then fetching the current record, before fetching data from it.

However, the way in which the recordset walk works, the valid function
checks whether the _record_ itself is valid, whilst the current allows
for a callback to be applied.

In this instance, the data-entry was failing because the count of
indexfields was < 2. The recordset data itself was valid, but the view
was not, and as a result, the current() function returned false.

This false was not previously handled.

I've changed the logic so that we handle this case, and have removed a
double-negative in the process.
search/classes/skip_future_documents_iterator.php