When upgrading to the latest release of search api, a PHP notice 'Undefined index: data' gets thrown. I tracked the source of the problem down to search_api_update_7116():

    $insert = db_insert('search_api_task')
      ->fields(array('server_id', 'type', 'index_id', 'data'));
    foreach ($tasks as $task) {
      $insert->values($task);
    }

'data' should be left away from the fields array, because there is no such key in any $task.

Comments

drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new482 bytes

Thanks for reporting this problem! While not harming the functionality in any way, we should of course try to not produce any notices. I actually thought Drupal's database layer would take care of this for us, but it seems we have to ensure that all fields are present, even if they should be NULL/the default.
Patch attached.

drunken monkey’s picture

Status: Needs review » Fixed

Committed (even though it might be a bit too late for most).

  • Commit e424e73 on 7.x-1.x by drunken monkey:
    Issue #2169455 by drunken monkey: Fixed "undefined index" in...

Status: Fixed » Closed (fixed)

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