Comments

drunken monkey’s picture

Status: Needs review » Fixed

Committed.

drunken monkey’s picture

StatusFileSize
new444 bytes

Committed the attached one-line follow-up.

pbuyle’s picture

$index->options['fields'] is still used in SearchApiDbService::addIndex. I'm not sure if this is ok or not.

Weirdly, when using an exported index (via Features) in Simpletest test cases, I get "Unknown field specified as search target." SearchApiExceptions, but when using the same exported index outside my test cases for manual testing, I don't have any issue. Using $index->getFields() in SearchApiDbService::addIndex solves the issue.

drunken monkey’s picture

StatusFileSize
new587 bytes

Ah, you're right, thanks! Thought it would be OK there, but there is a small issue – and anyways: better safe than sorry.
However, I don't think that will fix the SimpleTest error, which seems to be a bit weird. Might well be that is just due to a Simpletest-peculiarity – I've run into those before, there seem to be some obscure issues with Form API.

Anyways, patch attached.

drunken monkey’s picture

Status: Fixed » Needs review
tanc’s picture

pbuyle’s picture

StatusFileSize
new1.04 KB

The patch in #4 only addresses the $index->options['fields'] in the foreach, but before that options['fields'] is also used. It is probably ok, but as said: better safe than sorry. The attached patch replace the 3 usages of $index->options['fields'] in SearchApiDbService::addIndex.

And yes, sadly it doesn't save the Simpletest issues I'm having since #1308638: Reduce size of stored index settings :(

drunken monkey’s picture

Please test the patch in #4, the other use is definitely OK.

drunken monkey’s picture

Status: Needs review » Fixed

Committed this, hopefully nothing grave turns up now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.