function facetapi_map_assoc(&$array, $name, $key) {
  $array[$key] = drupal_map_assoc($array[$key]);
}

A quick array_key_exists() check here would prevent any undefined index errors. The patched attached below does that. But note that the array_key_exists() here will end up creating a copy of $array, introducing a (probably, hopefully) slight performance overhead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dags created an issue. See original summary.

dags’s picture

Issue summary: View changes
eugene.ilyin’s picture

Status: Active » Postponed (maintainer needs more info)

I cannot just apply it. I have to know how to reproduce the problem

andrezstar’s picture

I did have the same error (when clearing caches so the facettes are generated in the map) when there was a declaration of the hook_facetapi_facet_info_alter to define a "map callback"
I did fix the error when I added the property "field api bundles"

So i let it like this:
$facet_info['my_field']['map callback'] = 'my_module_my_field_map_callback';
$facet_info['my_field']['field api bundles'] = array();

I guess the patch, aint absolutely needed but might be nice as well.

jyraya’s picture

Status: Postponed (maintainer needs more info) » Needs review

Hello,

I was looking to this issue when I saw that the patch is already committed in the dev branch via #2373023: Undefined index: field api
If you check this commit, you will see that the #2 patch is already committed.

So for me, the current issue can be closed.

I put the state of the issue to "needs review" to allow maintainers to make a last check .

Status: Needs review » Needs work