Active
Project:
Environment Indicator
Version:
7.x-2.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
12 Jun 2015 at 07:35 UTC
Updated:
12 Jun 2015 at 07:35 UTC
With SQLite3, when I add an environment I get this error :
PDOException: SQLSTATE[HY000]: General error: 25 bind or column index out of range: SELECT COUNT(*) FROM {environment_indicator_environment} WHERE machine = ':machine'; Array ( [:machine] => demo ) in environment_indicator_machine_available() (line 269 of /var/www/drupal/sites/all/modules/contrib/environment_indicator/environment_indicator.module).
To correct it I have to remove quotes :
function environment_indicator_machine_available($machine) {
return db_query("SELECT COUNT(*) FROM {environment_indicator_environment} WHERE machine = ':machine'", array(':machine' => $machine))->fetchField() > 0 && $machine != 'overwritten_environment';
}
becomes :
function environment_indicator_machine_available($machine) {
return db_query("SELECT COUNT(*) FROM {environment_indicator_environment} WHERE machine = :machine", array(':machine' => $machine))->fetchField() > 0 && $machine != 'overwritten_environment';
}