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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2169455-1--incomplete_tasks_in_update_hook.patch | 482 bytes | drunken monkey |
Comments
Comment #1
drunken monkeyThanks 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.
Comment #2
drunken monkeyCommitted (even though it might be a bit too late for most).