Running Drupal 7.23, Rich Snippets 7.x-1.0-beta3+0-dev, and ApacheSolr 7.x-1.5.

When attempting to visit /search/site or /search/node or /search/user, result is an error 500 and the following entry in the apache error log:

PHP Fatal error: Call to undefined function apachesolr_get_index_key_map() in /[$SITEROOT]/sites/all/modules/rich_snippets/rich_snippets.apachesolr.inc on line 133

I couldn't find anything relevant in Google, SO, or d.o. Any recommendations? Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JimCraner’s picture

Downgrading apachesolr from 7.x-1.5 to 7.x-1.4 is a workaround for this problem for now. Please let me know if this issue should be reported in that queue instead. Thanks!

cpliakas’s picture

Looks like Apache Solr Search Integration changed it's APIs. We should fix here, but let's also post an issue to Apache Solr Search Integration so it can be more cognizant of function changes or reorganization of files containing these functions.

almc’s picture

Priority: Normal » Major
Issue summary: View changes

Due to this issue the module is basically not working with the current version of Apachesolr, and moreover not allowing Apachesolr search to function, so updated priority to major (critical for search with Apachesolr).

cpliakas’s picture

Priority: Major » Critical

I think it is critical. Discussed with Nick_vh, and it looks like there is logic we could add to this module to resolve and be backwards compatible with older versions of the Apache Solr Search Integration module.

weiteh’s picture

Same issue here. I am using apachesolr 7.x-1.6 and drupal failed on exactly the same line. Are there any workaround at this point?

RealGecko’s picture

Apachesolr 7.x-1.6
Schema.org 7.x-1.0-beta4
Rich Snippets 7.x-1.0-beta3 (or 7.x-1.0-beta3+0-dev)
Drupal 7.26
Still an issue :(

navalogan’s picture

Hi everybody i had the same problem! any solution?

capellic’s picture

I just ran into this problem with Apachesolr 1.6. Any progress? I checked the issue queue for Apache Solr Search and I don't see the case said to have been reported in comment #2 above. I tried the Dev version but that didn't work. Downgrading per comment #1 worked.

cpliakas’s picture

I see 4 potential contributors above to help identify and resolve the issue. Would love to have your first credited commit to be against this project!

I am assuming that this is due to one of the functions in the rich_snippets.apachesolr_legacy.inc file being defined in the latest version of the Apache Solr Search module.

There is a condition in the rich_snippets.apachesolr.inc file that loads the rich_snippets.apachesolr_legacy.inc file.

I would love to get some more people contributing, this is a great way to dive in. Happy to provide any additional guidance that is required whether it is on the code or how to contribute.

samuel.mortenson’s picture

I ran into this too, and have two ideas for fixes. Do the module maintainers have a preference between the two? I can whip up a patch for either.

  1. Wrap the function definitions themselves in if statements. I've tried this and it looks like it works, but it seems hacky (I guess so does including legacy functions?).
  2. Have an .inc file for each function and have two if statements to check if either or both need loaded
cpliakas’s picture

Hi samuel.mortenson .

Thanks for offering to help. I personally like #2, but I will leave it up to you and will accept either technique.

Thanks!
Chris

samuel.mortenson’s picture

Status: Active » Needs review
FileSize
10.52 KB

Alright, I've made a patch that separates the legacy functions into different files/if statement blocks. apachesolr_get_index_key_map is checked after apachesolr_get_field_mappings as it makes calls to apachesolr_get_field_mappings. I've tested this patch and it seems to work for me, but someone else in the thread should try it out too.

cpliakas’s picture

Status: Needs review » Reviewed & tested by the community

Great work! Thanks for the contribution.

cpliakas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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