ObjectPreview: fix inline Service Template links...

...for Service Sets

fixes #2334
This commit is contained in:
Thomas Gelf 2021-05-28 10:48:29 +02:00
parent ec87cd0ec2
commit 40544ac935
2 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,7 @@ next (will be 1.9.0)
* FIX: show Override button when all Fields belong to Field Categories (#2303)
* FIX: show Services applied with Rules involving applied Hostgroups (#2313)
* FIX: Overrides for Services belonging to Sets on root Host Templates (#2333)
* FIX: Service Set preview inline Service Template links (#2334)
* FEATURE: show "deprecated" flag on object attribute inspection (#2312)
* FEATURE: Service Template for single Host services provides auto-completion (#1974)

View File

@ -141,9 +141,13 @@ class ObjectPreview
return $match[1] . $match[2] . $match[3];
}
$urlObjectType = $this->object->getShortTableName();
if ($urlObjectType === 'service_set') {
$urlObjectType = 'service';
}
return $match[1] . Link::create(
$match[2],
sprintf('director/' . $this->object->getShortTableName()),
sprintf("director/$urlObjectType"),
['name' => $match[2]]
)->render() . $match[3];
}