Hi,

IT appears that OG access control prevents nodes to be indexed for not public content. Originally I attributed this to taxonomy module (since this is where bug originally manifested - see my post http://drupal.org/node/63392).

Also seems like this issue have manifested before (see post http://drupal.org/node/56209) and have remained unresolved for some time.

Sincerely
Maris

CommentFileSizeAuthor
#10 patch_19.txt2.88 KBmgabalins

Comments

pwolanin’s picture

Title: OG access control interfares with search indexing » OG access control interferes with search indexing

I've also gotten the exact same error messages described at: http://drupal.org/node/63392

However, they have not really recurred in the last couple days. I did set the search module to re-index, so maybe that solved it. OG access control is has been enabled throughout.

pwolanin’s picture

I take it back- it happened again today, but it seems as though the frequency and number of errors has been reduced.

Also, to dispute the hypothesis of this post, another user seeing these errors does not have OG installed:

http://drupal.org/node/63407

mgabalins’s picture

When I switch of OG access control all new nodes get indexed, whe I switch it back new added nodes are not indexed any more, but instead I got error in log from taxonomy module.

Modules installed(enabled) in my case:
- attachment
- block
- book
- bookmarks
- comment
- contact
- filemanager
- filter
- help
- image
- menu
- node
- og
- og_basic
- page
- path
- profile
- search
- smtp
- story
- system
- taxonomy
- tinymce
- tracker
- user
- watchdog
- workspace

mgabalins’s picture

Title: OG access control interferes with search indexing » OG access control interferes with search indexing - little more detective work

Putting number of debuging prints etc etc. - found that node data is not being loded by node_load (called from node_update_index, called from serach_cron). Select statement generated form noda date load looks something like this:

SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, 
       n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, 
       r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data 
  FROM node n INNER JOIN users u ON u.uid = n.uid 
              INNER JOIN node_revisions r ON r.vid = n.vid 
 WHERE n.nid=%d

this statement works just fine, however after db_query_rewrite SQL statement looks like this:

SELECT DISTINCT(n.nid), n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote,
       n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, 
       r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data 
  FROM node n INNER JOIN users u ON u.uid = n.uid 
              INNER JOIN node_revisions r ON r.vid = n.vid 
              INNER JOIN node_access na ON na.nid = n.nid 
 WHERE (na.grant_view >= 1 
   AND ((na.gid = 0 AND na.realm = 'all') OR 
        (na.gid = 0 AND na.realm = 'og_public') OR 
        (na.gid = 0 AND na.realm = 'og_all'))) 
   AND n.nid = %d;

and this statement returns empty set - just for the record for this particular node which I traced:

+-----+-----+---------------+------------+--------------+--------------+
| nid | gid | realm         | grant_view | grant_update | grant_delete |
+-----+-----+---------------+------------+--------------+--------------+
|  60 |   1 | og_subscriber |          1 |            1 |            1 |
+-----+-----+---------------+------------+--------------+--------------+

So I hope someone familiar with Organic group access control may give some input here.

Sincerely
Maris

mgabalins’s picture

Probably the most reasonable approach would be to disable rewriting during CRON run - directly in node.module (or at least add additional parameter &rewrite=true to node_load (and change call appropriately). As In understand similarar not idexeing behaviour have cropped out also for people not usig OG, but other access control schemas, reason mey be same.

pwolanin’s picture

Looks like this should be reclassified as a core or search module issue if it's not specific to any particular access control module.

nikle’s picture

Has anyone come up with a quick fix in the meantime?

mgabalins’s picture

Yes there is patch created at http://drupal.org/node/64857

nikle’s picture

Thanks for the follow up Maris. I have replaced node.module with your new file however suffer fromt he same problem. I have tried reindexing the search and running site.com/cron.php however I still have 0% indexed.

Are there any additional steps which need to be taken? Running 4.7.1

mgabalins’s picture

StatusFileSize
new2.88 KB

Hi,

This uploaded module actually was from 4.7.0 distribution, I have patch for 4.7.1 (attached)

It worked for me, so it is difficult to say what may be reason, if it is not working for You.

Sincerely
Maris

moshe weitzman’s picture

are these missing nodes marked as public? if not, they are being rightfully omitted from search which attempts to index everything as an anonymous user would see it.

mgabalins’s picture

Hi,

Hi, those nodes are not marked as public, however I think You are wrong becouse those nodes still have to be included in search index, otherwise even authprised users are not able to find them - e.g. decision about weather to show node in search result is shown should be determined when search is executed, not when index is made.

Maris

nikle’s picture

I wouldn't go to say that Moshe is wrong as this is likely the programed behavior of the module; however, I agree that I would like the functionality of non-public nodes being indexed. I am using drupal to facilitate sharing readings, notes and class info; however, only students registered in the class (in the organic group) should have access to the content. These students still want to be able to search through all the content.

Would this require additional work on Organic Groups or perhaps on the Search? Furthermore does anyone know if the securesite module can help?

pwolanin’s picture

I think this is not specific to OG, and is rather a Drupal search module problem

see: http://drupal.org/node/64857

killes@www.drop.org’s picture

Status: Active » Closed (duplicate)