hook_node_grants() is returning the wrong data structure based on the hook documentation. The module is returning the following structure:

$grants['simple_access'] = array(
  1 => array('gid' => 1'),
);

When it should be returning:

$grants['simple_access'] = array(1);

This problem manifests itself when the simple_access module is used in conjunction with the apachesolr_access module. The combination generates an invalid Solr query due to the $grant['simple_access'] value having a nested array.

CommentFileSizeAuthor
#1 simple_access-1151974-2.patch608 bytesshawn_smiley

Comments

shawn_smiley’s picture

StatusFileSize
new608 bytes

Here is a patch that resolves the issue for me. I'm not positive that this is the best solution though.

laroccadahouse’s picture

I was getting:

Warning: trim() expects parameter 1 to be string, array given in SolrFilterSubQuery->addFilter() (line 66 of/disks/www/mycehd/sites/all/modules/apachesolr/Solr_Base_Query.php).

and

apache solr seach engine is not available

for any user besides Admin

this patch fixed both errors for me

Thanks!! SAVED THE DAY!

simon georges’s picture

Status: Active » Reviewed & tested by the community
gordon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. Committed to Dev

Status: Fixed » Closed (fixed)

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

  • Commit fe18f24 on 7.x-2.x, 8.x-3.x by gordon:
    Issue #1151974 by shawn_smiley: Fixed Hook_node_grants() returns...