Running the roles audit (drush audit_roles) on any Drupal 7 site fails with a fatal error: Column not found: 1054 Unknown column 'uid' in 'field list''.

CommentFileSizeAuthor
#2 2804779-role_audit_fatal-1.patch640 bytesrbayliss
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rbayliss created an issue. See original summary.

rbayliss’s picture

Status: Active » Needs review
FileSize
640 bytes

I think this should do the trick.

junaidpv’s picture

Yes, there is no uid field in both table in query! Happened in this commit: http://cgit.drupalcode.org/site_audit/commit/?id=0369ed5eb4e145c7744302c0635fa6f2d3cd7e95

vagelis-prokopiou’s picture

Status: Needs review » Reviewed & tested by the community

The patch works as expected. Output of drush audit_roles on a fresh install:

Roles: Info
  administrator: 1, anonymous user: 0, authenticated user: 2
  administrator: 62 (89%), anonymous user: 3 (4%), authenticated user: 5 (7%)
socketwench’s picture

Status: Reviewed & tested by the community » Closed (outdated)

This appears to be fixed in another issue, since the current line is now:

$sql_query .= ', COUNT({role}.rid) AS count_permissions ';