Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Sep 2010 at 13:41 UTC
Updated:
4 Apr 2020 at 08:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
chx commentedHere we go.
Comment #2
moshe weitzman commentedComment #3
dries commentedCommitted to CVS HEAD. Thanks.
Comment #4
clemens.tolboomI meant on http://api.drupal.org/api/group/database/7 there is no mention of db_select.
See the patch containing a db_select example.
Comment #5
chx commentedHuh, really? The example is wrong as it does not use node access. Please change your patch to use node access and use a non-node example for the static string.
Comment #6
clemens.tolboomEhm ... what is wrong in not using 'node access'?
#4 shows a different approach for all "SELECT ... FROM node" on http://api.drupal.org/api/group/database/7
[ In short 'I don't copy' :( ]
Comment #7
chx commented->addTag('node_access')http://api.drupal.org/api/drupal/developer--examples--node_access_exampl...Edit: node listing queries must use the node_access tag same as db_rewirte_sql of old.
Comment #8
berdirShould be wrapped at 80 chars, nodes instead of node.
You can write this in a single line, ->fields('node', array('nid', 'title', 'created'))
Also, you should be using chained method calls.
When adding an example, it should be done correctly.
Powered by Dreditor.
Comment #14
daffie commentedComment #15
daffie commented