mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix duplicate maps in relationship (#16081)
When a device is added to a map multiple times, it caused the map to show multiple times in the device overview.
This commit is contained in:
@@ -802,7 +802,8 @@ class Device extends BaseModel
|
||||
|
||||
public function maps(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(CustomMap::class, CustomMapNode::class, 'device_id', 'custom_map_id', 'device_id', 'custom_map_id');
|
||||
return $this->hasManyThrough(CustomMap::class, CustomMapNode::class, 'device_id', 'custom_map_id', 'device_id', 'custom_map_id')
|
||||
->distinct();
|
||||
}
|
||||
|
||||
public function mefInfo(): HasMany
|
||||
|
Reference in New Issue
Block a user