The installation on 7.x drupal doesn't work because db_query return an object so that code is wrong !

$rid = db_query("SELECT 1 FROM {role} WHERE name LIKE 'admin%%'");
  if (!$rid) {

I fixed with that :

$rid = db_query("SELECT 1 FROM {role} WHERE name LIKE 'admin%%'");
  if (!$rid->rowCount()) {

The patch in attachment

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Fabulous’s picture

Issue summary: View changes
FileSize
487 bytes
Fabulous’s picture

Status: Active » Patch (to be ported)
liquidcms’s picture

Status: Patch (to be ported) » Needs review

i'll commit something similar:

$rid = db_query("SELECT 1 FROM {role} WHERE name LIKE '%admin%'");
if (!$rid->rowCount()) {
Dave Reid’s picture

Status: Needs review » Needs work

It would be better to do something like this and properly use db_like() as well:

if (!db_query("SELECT 1 FROM {role} WHERE name LIKE :name", array(':name' => '%' . db_like('admin') . '%'))->fetchField()) {
   ...
}
liquidcms’s picture

Status: Needs work » Fixed

i committed Dave's version to 1.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Fabulous’s picture

Assigned: Fabulous » Unassigned
Status: Closed (fixed) » Patch (to be ported)

I've just download the 7.x-1.0 version and the patch is not in... Please fix it.

liquidcms’s picture

Priority: Critical » Normal

as stated in #5.. the fix is in the -dev release (how did this tagged as critical?)

liquidcms’s picture

Status: Patch (to be ported) » Fixed

this is included in 7.x-1.1

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.