Skip to content

Commit

Permalink
add the linked key_id's even if they aren't currently linked. Require…
Browse files Browse the repository at this point in the history
…d for headings which only get 1 row which might not link objects other things do link to.
  • Loading branch information
sol1-matt committed Oct 6, 2022
1 parent 3d00899 commit 46e2d4e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion library/Netbox/Netbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ private function makeHelperKeys(array $in) {
}
$row->{$key . '_keyid'} = $this->keymaker($v->name, $key);
}
}
} elseif (is_null($v) and array_key_exists($k, $this->type_map)) {
$key = $this->type_map[$k];
$row->{$key . '_keyid'} = NULL;

}
}

// Custom fields for Netbox
Expand Down Expand Up @@ -451,6 +454,10 @@ public function devices($filter, int $limit = 0)
$this->type_map = array(
"device_role" => "device_role",
"parent_device" => "device",
"platform" => "platform",
"location" => "location",
"rack" => "rack",
"cluster" => "cluster",
"site" => "site",
"tenant" => "tenant"
);
Expand Down

0 comments on commit 46e2d4e

Please sign in to comment.