Account created on 29 April 2010, about 14 years ago
#

Recent comments

πŸ‡ͺπŸ‡ΈSpain GoddamnNoise

Hi Mahyar,

How can I transfer the ownership of this module to you?

πŸ‡ͺπŸ‡ΈSpain GoddamnNoise

Yes, i've tried to apply the patch in #225 with no success.

πŸ‡ͺπŸ‡ΈSpain GoddamnNoise

I think I have the same problem here with Drupal 7.31 (running over MySQL), Search By Page 7.x-1.3 and Profile 2 7.x-1.3 modules. If you create a profile for a user wich contains the word X and a create a node with the same word and then index all the content on the site, if you search for the word X with uid=1, then you get two search results (the node and the user profile), but if you search for the word X as anonymous user, then you get only one result (the node).

The problem here is that the Search By Page module tags the query with the node_access tag, so Drupal core rewrites the query to check for node access permissions. This works ok with nodes, but not when searching for users because the node_access table shouldn't be checked for users. This is the SQL query once Drupal core has rewritten it:

SELECT i.type AS type, i.sid AS sid, SUM((11.1543620469 * i.score * t.count)) AS calculated_score
FROM 
search_index i
INNER JOIN sbp_path sp ON i.sid = sp.pid
LEFT OUTER JOIN node sbpn_n ON sbpn_n.nid = sp.modid
LEFT OUTER JOIN db_temporary_0 sbpp_p ON sbpp_p.pid = sp.modid
LEFT OUTER JOIN users sbpu_u ON sbpu_u.uid = sp.modid
INNER JOIN search_total t ON i.word = t.word
INNER JOIN search_dataset d ON i.sid = d.sid AND i.type = d.type
WHERE  (sp.environment = :db_condition_placeholder_0) AND (sp.language = :db_condition_placeholder_1) AND( (0=1) OR( (sbpn_n.status = :db_condition_placeholder_2) AND (sp.from_module = :db_condition_placeholder_3) )OR( (sp.from_module = :db_condition_placeholder_4) )OR( (sbpu_u.status = :db_condition_placeholder_5) AND (sp.from_module = :db_condition_placeholder_6) ))AND( (i.word = :db_condition_placeholder_7) )AND (i.type = :db_condition_placeholder_8) AND ( EXISTS  (SELECT na.nid AS nid
FROM 
node_access na
WHERE (( (na.gid = :db_condition_placeholder_9) AND (na.realm = :db_condition_placeholder_10) ))AND (na.grant_view >= :db_condition_placeholder_11) AND (sbpn_n.nid = na.nid) )) AND( (d.data LIKE :db_condition_placeholder_12 ESCAPE '\\') )
GROUP BY i.type, i.sid
HAVING  (COUNT(*) >= :matches) 
ORDER BY calculated_score DESC
LIMIT 10 OFFSET 0

As you can see, the problem is in the " EXISTS (SELECT na.nid AS nid..." subquery when the "LEFT OUTER JOIN users" is present.

Hope this helps to catch this annoying bug in Drupal Core.

Production build 0.69.0 2024