I discovered the bug when clicking the "check connection" link in the sphinx search administration page. This error ONLY occurs when the connection to searchd fails. The reason for the fatal error is that a method is called from an undefined variable on line 354 of the sphinxsearch.admin.inc file. Specifically, $sphinxsearch->GetLastError() is being invoked before $sphinxsearch has been initialized. The patch included with this bug report moves the $sphinxsearch = &sphinxsearch_get_client(); command to a earlier location in the function so that it is initialized before it is used. I have tested the code with the patch applied, and the appropriate messages are displayed even when the connection to searchd fails.

CommentFileSizeAuthor
sphinxsearch.admin_.inc_.patch662 bytescpliakas

Comments

markus_petrux’s picture

Status: Needs review » Reviewed & tested by the community

I already noticed this when porting to D6, but forgot to patch de D5 branch. I will as soon as possible.

Thanks for reporting. :)

cpliakas’s picture

Sounds good. Great job with the module! It's refreshing to see how cleanly it is coded.

markus_petrux’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in CVS, release 1.2 is on the go. :)

markus_petrux’s picture

Status: Fixed » Closed (fixed)