This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

db_rewrite_sql not rewriting SQL as expected

Hello,

The site on which I work uses the organic groups (og) module. It implements the rewrite_sql hook so that all node/comment/whatever queries only return those which have proper permissions under the og permission system. I have created a view which lists a certain set of nodes, but the SQL isn't be rewritten as I expect. Here is the SQL before the rewrite:

buddylist module view filter generating incorrect SQL

Hello,

I'm new to the world of views and it's all a bunch of voodoo to me. The buddylist module provides a filter that adds a "author is buddy of current user" filter, e.g., so as to make a page of all nodes authored by your buddies. My objective is to get a list of all published nodes of the current user's buddies within a certain taxonomy. The SQL that the buddylist filter generates is as follows:

SELECT DISTINCT(node.nid) FROM node node LEFT JOIN buddylist buddylist ON users.uid = buddylist.buddy LEFT JOIN users users ON node.uid = users.uid LEFT JOIN users buddylist_users ON buddylist.uid = buddylist_users.uid LEFT JOIN term_node term_node ON node.nid = term_node.nid LEFT JOIN term_data term_data ON term_node.tid = term_data.tid WHERE (buddylist_users.uid = '12436') AND (node.status = '1') AND (term_data.vid = '4') ORDER BY node.created DESC LIMIT 0, 12;

Aside from the fact that this has one too many joins, the first join references the users table when in fact it should be referencing the node table. The better, hand-coded SQL to generate the list of nodes is as follows:

select distinct(n.nid) from buddylist b join node n on (n.uid = b.buddy) left join users u on (u.uid=n.uid) left join term_node tn on (tn.nid = n.nid) left join term_data td on (tn.tid = td.tid) where b.uid=12436 and td.vid=4 and n.status=1 order by n.created desc limit 0,12;

no break or teaser with flexinode or cck

this is ridiculous. the front page of a website has to be controllable. web editors must have the ability to easily determine, node by node, how an item appears on the front page. some are happy with teasers; others need to use break. using out-of-the-box nodes -- page, story, etc -- this is easy. teaser works; break works.

CCK SQL error?

I could have sworn I'd seen this discussed once before on the forums, but I'll be darned if I can find the thread ... so I apologize if this is a re-post.

I'm running Apache 2, PHP 5.1.4, and MySQL 5.0.27 on Windows XP.

I am trying to create a new node type using CCK. The type gets created (I can create the type, edit the title), but when I attempt to add a field, I get this error:

UIE forum

i installed UIE forum. i found that only the administrator can access the forum. anonymous and other authorised users can not access the forum. i already ticked access for those two user groups. any body has the similiar problems? thx.

bing

Why use Drupal.jsEnabled?

I'm just curious why there's a Javascript killswitch at all... It seems redundant to set a constant using Javascript to tell other scripts that Javascript is indeed enabled.

If it's just so we know drupal.js has been fired, if our Javascript doesn't rely on any of that code do we really even need to check the constant?

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions