The 6.x-3.x version of this module seems to depend on a function only available in Drupal 7:

function apachesolr_fields_list_facet_map_callback($facets, $options) {
  ..  
  $fields = field_info_fields();

I might be missing something here, it seems strange it's not already reported as this seems like a critical blocker to using the module on Drupal 6.

Comments

seddonym’s picture

Just as an experiment I replaced the following:

  • field_info_fields() with content_fields()
  • node_reference_potential_references() with _nodereference_potential_references()
  • field_filter_xss() with filter_xss()

This seemed to get the module basically working, but not very smoothly. I haven't the time to test it now but thought it would be helpful to report.

epiraces’s picture

I got the same issue. I'll try what you suggest but it would be would to get input from others too.

epiraces’s picture

For what is worth, if Facets API is disabled, at least results are displayed.

sja1’s picture

Priority: Normal » Critical

I'm experiencing the same error.

Fatal error: Call to undefined function field_info_field() in path_to_module/facetapi/plugins/facetapi/dependency_bundle.inc on line 20

Changing priority to critical as this would seem to make the module unusable.

nick_vh’s picture

Project: Apache Solr Search » Facet API

Seems this is a facetapi problem right?

sja1’s picture

Yes, thanks for redirecting to the correct queue!

voidberg’s picture

Assigned: Unassigned » voidberg
rares’s picture

StatusFileSize
new3.65 KB

The solution in #1 also worked for me (patch below). To fix this, I actually patched apachesolr.module. So I think this issue belongs in the apachesolr queue.

While testing I found that the facets for nodereference fields were not showing the titles of the related nodes. After debugging I found that the 6.x-3.x facetapi.module expects the map callback to return a simple array of type $map[$key] = $value; (instead of $map[$key]['#markup'] = $value;). My patch also addresses this issue.

relaxy’s picture

There is also a Facet API issue.

Facet API module calls the function field_info_field on line 20 in the dependency_bundle.inc module.

However field_info_field is a part of Drupal 7 API and should not be used inside of the Drupal 6 module.

rares’s picture

Looked more closely at the thread. Looks like the OP reported the issue in the context of apachesolr.module, and #4 reported the function being called in facetapi (dependency_bundle.inc). Calls to these D7 Content functions exist in both. My patch solves the issue in the apachesolr module and makes the facets work inside solr search. Perhaps I should file a similar issue in the apachesolr queue?

cpliakas’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, solrpatch.patch, failed testing.

relaxy’s picture

Yep. The problem should be fixed on the both sides.

(#4) still exists even after the patch.

voidberg’s picture

Status: Needs work » Needs review
StatusFileSize
new1.44 KB

The patch in #8 is for apachesolr so once we fix the issue in #4 we should move it back to the apachesolr module queue. It works in this context as long as you don't have any facets that have a dependency set otherwise it will crash.

I am attaching a patch that removes the call to field_info_fields.

voidberg’s picture

Status: Needs review » Fixed
voidberg’s picture

Project: Facet API » Apache Solr Search
Assigned: voidberg » Unassigned
Status: Fixed » Active

I am moving this issue back into the apachesolr queue as the issues in Facetapi have been fixed.

rares’s picture

Status: Active » Needs review
StatusFileSize
new3.65 KB

resubmitting patch in #8. hope the test bot accepts this.

relaxy’s picture

#17: solrpatch2.patch queued for re-testing.

nick_vh’s picture

Status: Needs review » Needs work

Is this also a problem in 7.x-1.xm, if so - we need to solve that first? I have a hard time following the flow here

nevermind - I'm being stupid :) Please, make the patch name a little more clear (at least the issue number in the filename)

nick_vh’s picture

Status: Needs work » Needs review

Aside of that, the patch looks good - just rename it so it can be tracked

pwolanin’s picture

Status: Needs review » Needs work

cpliakas says you need to use #value in place of #markup in the patch, rather than assigning the HTML to the bare array element.

pwolanin’s picture

Status: Needs work » Needs review
StatusFileSize
new3.71 KB

re-roll

pwolanin’s picture

actually the #html should still be there too?

pwolanin’s picture

StatusFileSize
new3.64 KB

anyone want to test?

wonder95’s picture

Status: Needs review » Reviewed & tested by the community

I was able to apply the patch to the latest dev and it got rid of the error.

cedric_a’s picture

#25 is ok for me too, no more php fatal error when using facets dependencies, thanx.

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

committed.

Status: Fixed » Closed (fixed)

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