Closed (fixed)
Project:
Random Images
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2010 at 23:26 UTC
Updated:
4 Oct 2010 at 14:31 UTC
Under the following conditions:
1. Content Access module is enabled
2. It is not necessary to restrict page access for this test
3. Log in as an Authenticated User (other than user/1)
4. Click on a random image to be taken to the images node.
In place of the page heading, you will get:
* user warning: Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT title FROM blocks 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 = 8 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid'))) AND ( module='random_images' AND delta='1' AND theme='') in /home/[removed]/sites/all/modules/random_images/random_images.module on line 30.
* user warning: Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT title FROM blocks 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 = 8 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid'))) AND ( module='random_images' AND delta='1' AND theme='garland') in /home/[removed]/sites/all/modules/random_images/random_images.module on line 30.
Comments
Comment #1
DrewMathers commentedI have done a workaround for this problem by taking the displayed title from the pictures source page instead of the block title.
Comment #2
Ivan Simonov commentedI try to reproduce (user #1):
1) On the new site install Content Access & Random Images modules.
2) Enable both. Upload images for "Random Images".
3) Set block Tittle.
4) Rebuild access rights (/admin/content/node-settings/rebuild)
5) Click on image - No errors on /random_images/1 page.
6) Allow guests to see "Random Images" block and page.
7) Guest got error on "Random Images" page.
User warning: Unknown column 'n.nid'
But I am not use column 'n.nid'
Query is: "SELECT title FROM {blocks} WHERE module='random_images' AND delta='%d' AND theme='%s'"
I think we have to ask "Content Access" developer about this warning.
I suppose "Content Access" module rebuild query incorrect way.
For me your way not so good because Page Tittle in this case used for administrators, but Block Tittle shown for users (page is container and usually unpublished). What if somebody want to create 2 similar blocks with different tittles?
Anyway we need more info from "Content Access" developers.
Comment #3
DrewMathers commentedHere is a similar issue from the Content Access queue: #517810: Unknown column 'n.nid'
Comment #4
Ivan Simonov commentedYou right - incorrect use of db_rewrite_sql() function.
Check please this fix:
Remove db_rewrite_sql() function from line #30 and fluch cache.
$result = db_result(db_query($sql, $delta, $theme));Next commit will fix it.
Comment #5
tgeller commentedIrrelevant to your question: Congrats on creating node #900,000! ;)
Comment #6
Ivan Simonov commentedI find this number fun too :) Where is a prize?
Comment #7
Ivan Simonov commentedFixed in 6.x-1.x-dev