User login


Check if a given uid has a given permission (a query to avoid user_load)

a good D7 query for determining if a user has a specific permission
via agentrickard

what's wrong with user_access('permission', $account) ?

it requires a user_load_multiple() (a user_load to get the roles on the account, turning in the ID is not enough)

which is wasteful if you can do it at the query level

you could see what queries that function runs

it seems like that is a somewhat complicated thing to work out
since users can belong to many roles

how many users is this for at a time? I'd just use user_load() + user_access().

OpenCalais on the command line

Erik Sundelof recommends experimenting with <a">Calais via the command line.


gem calais

Then can create code with the queries you need.

Get 50,000 queries a day with their personal account, but each query has a wealth of information you can dive into deeper. Maybe even getting related information within the same query?

Anyhow, cool.

Must use ->fields() method in select statements in Drupal 7 database layer (DBTNG)

An error like this one:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM block block WHERE (theme = 'bartik')' at line 1: SELECT FROM {block} block WHERE (theme = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => bartik ) in xray_block_statistics() (line 80 of /home/ben/workspace/dgd7all/sites/default/modules/xray/xray.module).

[unsolved] putting a query string in a menu local task tab link item

any experience working with hook_menu, specifically for tabs
(menu_local_task items)
how would one pass a query from one of those links?
for instance, working with organic groups, on the group nodes, want tabs for adding new content inside the group
so the link needs to be something like
876 being whatever the current group context is

Syndicate content