I have installed FacetAPI and SearchAPI and they work fine. However, when I enable "Search facets" the system returns an error:
Notice: Undefined index: field api bundles in facetapi_map_assoc() (line 726 of /var/www/sites/all/modules/facetapi/facetapi.module).
The error disappears the moment I disable Search facets" again.
Notice: both FacetAPI and SearchAPI run the latest version.
Anyone has an idea with how to solve this?
------
EDIT: Appears as if the error concerns each added Search index under Search API. Once I clear all the search indexes, the error is gone. Not sure if this a FacetAPI concern or a SearchAPI concern eventhough the error message relates to the facetapi.module.
Please advise.
Regards,
Nyborg
Comments
Comment #1
STNyborg CreditAttribution: STNyborg commentedComment #2
wsantell CreditAttribution: wsantell commentedSpeculating, based on how this happens on my site:
I modified the function at line 725 to print the array if $key isn't a key in $array:
I was only getting this error after cron ran, so I ran cron and it spit out:
As you can see, 'field api bundles' is not an index; drupal_map_assoc can't make the associative array because the linear array doesn't exist. My guess is that this is occurring for me due to having recently installed the Apache SOLR Search Attachments module, which indexes files attached to nodes.
I removed the else statement from the code above and implemented this to keep the notice from appearing.
Comment #3
eMuse_be CreditAttribution: eMuse_be commentedSame problem.
Also gives problems with facetapi_pretty_paths.
Related issue: https://www.drupal.org/node/2471563
Comment #4
mausolos CreditAttribution: mausolos commentedI made a patch to dispose of this error, though you should note that it doesn't necessarily solve whatever is actually CAUSING the root issue. However, I stand by this since it's generally good practice to test your variables for existence/viability before trying to act on them. Please test.
I built against:
search_api_facetapi 7.x-1.22
facetapi 7.x-1.5+22-dev
Comment #6
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedI cannot reproduce this error. Maybe it's already gone. But yes, this checking can be added.
If anybody will face this problem again, let me know, please.
Comment #7
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedComment #9
frederickjhI cleaned up the patch in #4 so it only patches the module and not .htaccess as well. This allows for automated patching of the module.
Comment #10
frederickjhOne more try, cleanup the path on this one.
Comment #11
frederickjhOne more time. I missed one level of the path.
Comment #12
julien.reulos CreditAttribution: julien.reulos commentedI don't think the maintainer included the update of the .htaccess file in his fix, see the corresponding commit (mentioned above): https://git.drupalcode.org/project/facetapi/commit/900bd713