mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Patch fix sql error on gengroupsql (#9929)
* Patch fix sql error on gengroupsql * Update device-groups.inc.php * Update device-groups.inc.php * Update device-groups.inc.php * Update device-groups.inc.php
This commit is contained in:
@@ -106,7 +106,7 @@ function GenGroupSQL($pattern, $search = '', $extra = 0)
|
|||||||
|
|
||||||
$pattern = rtrim($pattern, '&|');
|
$pattern = rtrim($pattern, '&|');
|
||||||
|
|
||||||
if ($tables[0] != 'devices' && dbFetchCell('SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_NAME = ? && COLUMN_NAME = ?', array($tables[0],'device_id')) != 1) {
|
if (!in_array('devices', $tables) && dbFetchCell('SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_NAME = ? && COLUMN_NAME = ?', array($tables[0],'device_id')) != 1) {
|
||||||
//Our first table has no valid glue, prepend the 'devices' table to it!
|
//Our first table has no valid glue, prepend the 'devices' table to it!
|
||||||
array_unshift($tables, 'devices');
|
array_unshift($tables, 'devices');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user