Hello,

I have this error message right after trying to save a new solr server.

mod_fcgid: stderr: PHP Fatal error: Unsupported operand types in /sites/all/modules/search_api_solr/service.inc on line 214, referer: /en/admin/config/search/search_api/add_server

CommentFileSizeAuthor
#6 1813670-unsupported_operand-6.patch654 bytesguillaumev

Comments

jbekker’s picture

Same problem using the latest dev release. After installing the latest stable version I was able to add a server.

brandon_beeler’s picture

Same error. Also have this error on other pages, but that might be related to what I describe below:
Notice: Undefined index: autocomplete in SearchApiSolrService->configurationFormSubmit() (line 214 of /srv/bindings/c2d231f42092438db05c75f0d0d30e9a/code/sites/all/modules/search_api_solr/service.inc).

It should be noted I used this patch http://drupal.org/files/1407282--variable_solr_connection_class-27.patch but I'm thinking this is unrelated since both of you are also experiencing the same error. Unless you are both using this also.

kurtzhong’s picture

I am also experiencing this using the latest dev version. And i am not using the patch mentioned above.

// on line 209 `var_dump($values)`  outputs:
Array (size=5)
  'host' => string '127.0.0.1' (length=9)
  'port' => string '8983' (length=4)
  'path' => string '/solr/' (length=6)
  'http' => 
    array (size=2)
      'http_user' => string '' (length=0)
      'http_pass' => string '' (length=0)
  'advanced' => 
    array (size=4)
      'excerpt' => int 0
      'retrieve_data' => int 0
      'highlight_data' => int 0
      'http_method' => string 'POST' (length=4)

I didn't find the key 'autocomplete'.

kurtzhong’s picture

I am doing a quick fix on my local changing line 214 to:

$values += !empty($values['autocomplete']) ? $values['autocomplete'] : array();
finex’s picture

The workaround suggested by @kurtzhong looks correct. Thanks :-)

guillaumev’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new654 bytes

I ran into this and can confirm the workaround suggested in #4 works just fine. Turning this into a patch.

drunken monkey’s picture

Priority: Normal » Major
Status: Reviewed & tested by the community » Fixed

Oops, sorry, totally missed that!
Thanks a lot for reporting and patching!
Patch committed.

Status: Fixed » Closed (fixed)

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